summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2023-07-31 05:05:43 +0800
committerBenBE <BenBE@geshi.org>2023-08-18 12:52:28 +0200
commit93d76fd37627a3594f52afda32092fa3858f28dc (patch)
tree2ce03a5ca873cbaa3db6c96f174fd8c037f07e8b /configure.ac
parentb416433fbe7ccf935ad4e268396aa423143c2318 (diff)
Add a check and warning about signaling NaN support to 'configure.ac'
Add a check of the '__SUPPORT_SNAN__' predefined macro and print a warning message if the compiler defines it. The warning is not printed with '--enable-debug' specified as we assume users know what they are doing. :) Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 07c3ee85..c05f4d62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -758,6 +758,22 @@ AC_ARG_ENABLE([debug],
[enable_debug=no])
if test "x$enable_debug" != xyes; then
AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"
+
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE([[
+#ifdef __SUPPORT_SNAN__
+#error "signaling NaN support not recommended"
+#endif
+ ]])],
+ :,
+ [warning_msg="signaling NaN support is enabled; not recommended for htop"
+ case "$CC" in
+ *gcc*)
+ warning_msg="$warning_msg (use '-fno-signaling-nans' compiler flag to disable)"
+ ;;
+ esac
+ AC_MSG_WARN([$warning_msg])
+ ])
else
AM_CPPFLAGS="$AM_CPPFLAGS -ggdb3"
fi

© 2014-2024 Faster IT GmbH | imprint | privacy policy