From 63f9565f371b2ad9060a0cfa4c40c90dfc4bd5e7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Aug 2021 23:40:41 +0200 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ m4/gnulib-common.m4 | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a6e8d6e997..8a31810301 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-22 Bruno Haible + + 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 c-stack: depend on inttypes, mempcpy diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 8a10e5bc15..5d667052d9 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -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 -- 2.39.5