]> Savannah Git Hosting - gnulib.git/commitdiff
Port _GL_HAS_C_ATTRIBUTE to pedantic gcc -std=c99
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 20 Apr 2022 01:23:37 +0000 (18:23 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 20 Apr 2022 01:24:24 +0000 (18:24 -0700)
* m4/gnulib-common.m4 (_GL_HAS_C_ATTRIBUTE):
Disable -Wpedantic if using __has_c_attribute and this is not C2x.

ChangeLog
m4/gnulib-common.m4

index c2509b8387fd1493ddbe6048f9994a158644560b..fee51331c89f1c961ce96b17058ca466bd800ea6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2022-04-19  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Port _GL_HAS_C_ATTRIBUTE to pedantic gcc -std=c99
+       * m4/gnulib-common.m4 (_GL_HAS_C_ATTRIBUTE):
+       Disable -Wpedantic if using __has_c_attribute and this is not C2x.
+
        verify: port to pedantic gcc -std=c99
        * lib/verify.h (_GL_VERIFY): If we lack both _Static_assert and
        static_assert, suppress -Wnexted-externs.
index c5ced04f181844195b6f0c37063618d9219f889e..30911d1581af8e537454e0a9bdb7027c7db008c1 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 72
+# gnulib-common.m4 serial 73
 dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -106,6 +106,10 @@ AC_DEFUN([gl_COMMON_BODY], [
 #endif
 
 #ifdef __has_c_attribute
+# if ((defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710 \
+      && _GL_GNUC_PREREQ (4, 6))
+#  pragma GCC diagnostic ignored "-Wpedantic"
+# endif
 # define _GL_HAS_C_ATTRIBUTE(attr) __has_c_attribute (__##attr##__)
 #else
 # define _GL_HAS_C_ATTRIBUTE(attr) 0