This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gcc-in-cxx] Define ATTRIBUTE_UNUSED_LABEL for C++
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 10 Feb 2009 22:40:07 -0800
- Subject: [gcc-in-cxx] Define ATTRIBUTE_UNUSED_LABEL for C++
Corresponding to the patch I just committed to support __attribute__
((unused)) on labels in C++, this patch defines ATTRIBUTE_UNUSED_LABEL.
This patch is not correct for mainline--it checks 4.4 where it should
check for after the 4.4 release. It works on the branch for now, and
I'll correct it before bringing it over to mainline. Committed to
gcc-in-cxx branch.
Ian
2009-02-10 Ian Lance Taylor <iant@google.com>
* ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Define for g++ 4.4.
Index: ansidecl.h
===================================================================
--- ansidecl.h (revision 143890)
+++ ansidecl.h (working copy)
@@ -256,13 +256,13 @@ So instead we use the macro below and te
# endif /* GNUC >= 2.96 */
#endif /* ATTRIBUTE_MALLOC */
-/* Attributes on labels were valid as of gcc 2.93. */
+/* Attributes on labels were valid as of gcc 2.93 and as of g++ 4.5. */
#ifndef ATTRIBUTE_UNUSED_LABEL
-# if (!defined (__cplusplus) && GCC_VERSION >= 2093)
+# if (defined (__cplusplus) ? GCC_VERSION >= 4004 : GCC_VERSION >= 2093)
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
# else
# define ATTRIBUTE_UNUSED_LABEL
-# endif /* !__cplusplus && GNUC >= 2.93 */
+# endif
#endif /* ATTRIBUTE_UNUSED_LABEL */
#ifndef ATTRIBUTE_UNUSED