gnulib-common.m4: Make _GL_UNUSED_LABEL effective for clang.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Aug 2021 20:11:50 +0000 (22:11 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Aug 2021 20:11:50 +0000 (22:11 +0200)
* m4/gnulib-common.m4 (gl_COMMON_BODY): Make _GL_UNUSED_LABEL use
_GL_ATTRIBUTE_UNUSED also for clang.

ChangeLog
m4/gnulib-common.m4

index 81f6d74a17d1879cc70496287fe2e2f100e12dea..370f972d6163a3d8973e61a9801e80da8560f6dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-22  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-common.m4: Make _GL_UNUSED_LABEL effective for clang.
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Make _GL_UNUSED_LABEL use
+       _GL_ATTRIBUTE_UNUSED also for clang.
+
 2021-08-22  Bruno Haible  <bruno@clisp.org>
 
        gnulib-common.m4: Use C2x [[maybe_unused]] when possible.
index 801c7127b2596e2a098a37b466eed442562be02d..8a10e5bc15053de3165027defa0047acf143ebde 100644 (file)
@@ -418,7 +418,7 @@ 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)
+#if (!defined __cplusplus || _GL_GNUC_PREREQ (4, 5)) || defined __clang__
 # define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
 #else
 # define _GL_UNUSED_LABEL