]> Savannah Git Hosting - gnulib.git/commitdiff
attribute: Try harder to avoid syntax errors.
authorBruno Haible <bruno@clisp.org>
Thu, 30 May 2024 14:33:55 +0000 (16:33 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 30 May 2024 14:47:47 +0000 (16:47 +0200)
* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_ATTRIBUTE_REPRODUCIBLE and _GL_ATTRIBUTE_UNSEQUENCED to empty if
_GL_BRACKET_BEFORE_ATTRIBUTE is defined.

ChangeLog
m4/gnulib-common.m4

index 6ea227c411d350583c3023e95d5d697be2e35357..2d96de1066c540c6b95b39b9c36834ad5b4201f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-30  Bruno Haible  <bruno@clisp.org>
+
+       attribute: Try harder to avoid syntax errors.
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Define
+       _GL_ATTRIBUTE_REPRODUCIBLE and _GL_ATTRIBUTE_UNSEQUENCED to empty if
+       _GL_BRACKET_BEFORE_ATTRIBUTE is defined.
+
 2024-05-30  Bruno Haible  <bruno@clisp.org>
 
        attribute: Improve comments.
index fba5158ced248652cccadb98d903e1ad6bea1c11..b34b4534bfe6e79dfd3e3df49c16f4183a6639b3 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-common.m4
-# serial 94
+# serial 95
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -556,9 +556,14 @@ AC_DEFUN([gl_COMMON_BODY], [
    <https://stackoverflow.com/questions/76847905/>.  */
 /* Applies to: functions, pointer to functions, function types.  */
 #ifndef _GL_ATTRIBUTE_REPRODUCIBLE
-# if _GL_HAS_ATTRIBUTE (reproducible)
-#  define _GL_ATTRIBUTE_REPRODUCIBLE [[reproducible]]
-# else
+/* This may be revisited when gcc and clang support [[reproducible]] or possibly
+   __attribute__ ((__reproducible__)).  */
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+#  if _GL_HAS_ATTRIBUTE (reproducible)
+#   define _GL_ATTRIBUTE_REPRODUCIBLE [[reproducible]]
+#  endif
+# endif
+# ifndef _GL_ATTRIBUTE_REPRODUCIBLE
 #  define _GL_ATTRIBUTE_REPRODUCIBLE
 # endif
 #endif
@@ -602,9 +607,14 @@ AC_DEFUN([gl_COMMON_BODY], [
    <https://stackoverflow.com/questions/76847905/>.  */
 /* Applies to: functions, pointer to functions, function types.  */
 #ifndef _GL_ATTRIBUTE_UNSEQUENCED
-# if _GL_HAS_ATTRIBUTE (unsequenced)
-#  define _GL_ATTRIBUTE_UNSEQUENCED [[unsequenced]]
-# else
+/* This may be revisited when gcc and clang support [[unsequenced]] or possibly
+   __attribute__ ((__unsequenced__)).  */
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+#  if _GL_HAS_ATTRIBUTE (unsequenced)
+#   define _GL_ATTRIBUTE_UNSEQUENCED [[unsequenced]]
+#  endif
+# endif
+# ifndef _GL_ATTRIBUTE_UNSEQUENCED
 #  define _GL_ATTRIBUTE_UNSEQUENCED
 # endif
 #endif