]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-common.m4: add _GL_UNUSED_LABEL
authorPádraig Brady <P@draigBrady.com>
Sun, 1 Jun 2014 21:25:28 +0000 (22:25 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 1 Jun 2014 21:46:52 +0000 (22:46 +0100)
* m4/gnulib-common.m4: Add _GL_UNUSED_LABEL which is similar to
_GL_UNUSED, but handles g++ < 4.5 not supporting this syntax.

ChangeLog
m4/gnulib-common.m4

index 0c8782bbd6c026bd9860b754911eb5d88e32042a..4ceaaee4369628a49311d0609a37b03e9c5cd7d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 20ce40e7441dcab0c3ccb5ca902e1f04b37d4e39..ba62c5865b7c7321a4e016f5d2d8f73351f80553 100644 (file)
@@ -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__))