From 64a1ab848f4cba7b9dd4705a169034e39048d27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 5 Feb 2021 15:20:00 +0100 Subject: [PATCH] configure: ignore usage of C11 _Generic on FreeBSD BatteryMeter.c:30:8: error: '_Generic' is a C11 extension [-Werror,-Wc11-extensions] if (isnan(percent)) { ^ /usr/include/math.h:114:2: note: expanded from macro 'isnan' __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl) ^ /usr/include/math.h:82:39: note: expanded from macro '__fp_type_select' #define __fp_type_select(x, f, d, ld) _Generic((x), \ ^ 1 error generated. --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 6fdb8173..7bac0426 100644 --- a/configure.ac +++ b/configure.ac @@ -531,6 +531,11 @@ AM_CFLAGS="\ -Wunused\ -Wwrite-strings" +# FreeBSD uses C11 _Generic in its isnan implementation, even with -std=c99 +if test "$my_htop_platform" = freebsd; then + AM_CFLAGS="$AM_CFLAGS -Wno-c11-extensions" +fi + dnl https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html AC_DEFUN([AX_CHECK_COMPILE_FLAG], [