]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-common.m4: Clarify logic behind _GL_UNUSED_LABEL.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Aug 2021 21:40:41 +0000 (23:40 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Aug 2021 21:40:41 +0000 (23:40 +0200)
Reported by Paul Eggert.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Add comment and write the
condition in a way that is close to the comment.

ChangeLog
m4/gnulib-common.m4

index a6e8d6e997889a90244400a9c04babf4ab7eaf14..8a31810301e16c7a974d870acaab391e68419bc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-22  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-common.m4: Clarify logic behind _GL_UNUSED_LABEL.
+       Reported by Paul Eggert.
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Add comment and write the
+       condition in a way that is close to the comment.
+
 2021-08-22  Paul Eggert  <eggert@cs.ucla.edu>
 
        c-stack: depend on inttypes, mempcpy
index 8a10e5bc15053de3165027defa0047acf143ebde..5d667052d90f59acb227b9a6c42665877b7cd5e1 100644 (file)
@@ -418,7 +418,9 @@ AC_DEFUN([gl_COMMON_BODY], [
    immediately preceding label is not used.  The compiler should not warn
    if the label is not used.  */
 /* Applies to: label (both in C and C++).  */
-#if (!defined __cplusplus || _GL_GNUC_PREREQ (4, 5)) || defined __clang__
+/* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
+   syntax.  But clang does.  */
+#if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
 # define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
 #else
 # define _GL_UNUSED_LABEL