When compiling a Gnulib testdir on FreeBSD 13.0, with libsigsegv installed,
I see this compilation error:

../../gllib/c-stack.c:174:6: error: function-like macro '__GNUC_PREREQ' is not 
defined
# if __GNUC_PREREQ (4, 6)
     ^
1 error generated.

This patch fixes it.


2021-04-14  Bruno Haible  <[email protected]>

        c-stack: Don't use an undefined C macro (regression from 2020-10-04).
        * lib/c-stack.c: Test GNU C version directly, without __GNUC_PREREQ.

diff --git a/lib/c-stack.c b/lib/c-stack.c
index 50caafa..b508d82 100644
--- a/lib/c-stack.c
+++ b/lib/c-stack.c
@@ -171,7 +171,7 @@ null_action (int signo _GL_UNUSED)
 #if USE_LIBSIGSEGV
 
 /* Pacify GCC 9.3.1, which otherwise would complain about segv_handler.  */
-# if __GNUC_PREREQ (4, 6)
+# 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
 #  pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
 # endif
 


Reply via email to