From 95b8588444b49e3d958aa31c30099e0efffd04bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sun, 1 Jun 2014 22:25:28 +0100 Subject: [PATCH] gnulib-common.m4: add _GL_UNUSED_LABEL * m4/gnulib-common.m4: Add _GL_UNUSED_LABEL which is similar to _GL_UNUSED, but handles g++ < 4.5 not supporting this syntax. --- ChangeLog | 6 ++++++ m4/gnulib-common.m4 | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0c8782bbd6..4ceaaee436 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-06-01 Pádraig Brady + + gnulib-common.m4: add _GL_UNUSED_LABEL + * m4/gnulib-common.m4: Add _GL_UNUSED_LABEL which is similar to + _GL_UNUSED, but handles g++ < 4.5 not supporting this syntax. + 2014-05-31 Paul Eggert dup2, fcntl, fcntl-h: port to AIX 7.1 diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 20ce40e744..ba62c5865b 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -49,6 +49,15 @@ AC_DEFUN([gl_COMMON_BODY], [ is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED +/* gcc supports the "unused" attribute on possibly unused labels, and + g++ has since version 4.5. */ +#if !defined __cplusplus || __GNUC__ > 4 \ + || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define _GL_UNUSED_LABEL _GL_UNUSED; +#else +# define _GL_UNUSED_LABEL +#endif + /* The __pure__ attribute was added in gcc 2.96. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -- 2.39.5