changeset 37369:30acbbdc9cf4

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.
author Pádraig Brady <P@draigBrady.com>
date Sun, 01 Jun 2014 22:25:28 +0100
parents e5dd5650c629
children 486cc749b527
files ChangeLog m4/gnulib-common.m4
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat May 31 14:07:57 2014 -0700
+++ b/ChangeLog	Sun Jun 01 22:25:28 2014 +0100
@@ -1,3 +1,9 @@
+2014-06-01  Pádraig Brady  <P@draigBrady.com>
+
+	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  <eggert@cs.ucla.edu>
 
 	dup2, fcntl, fcntl-h: port to AIX 7.1
--- a/m4/gnulib-common.m4	Sat May 31 14:07:57 2014 -0700
+++ b/m4/gnulib-common.m4	Sun Jun 01 22:25:28 2014 +0100
@@ -49,6 +49,15 @@
    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__))