public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PR other/54324: Do not set __attribute__ for GCC < 3.4
@ 2012-12-18 15:18 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2012-12-18 15:18 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

As discussed in the thread entitled "allow bootstrapping with older 
compilers", this patch disallows __attribute__ for GCC < 3.4.

Applied as obvious, as you mentioned in the other thread.

Thanks.

[-- Attachment #2: curr --]
[-- Type: text/plain, Size: 989 bytes --]

commit 370a6a8ddc628924c1deedf752ea9fc9a058d5cc
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Tue Dec 18 09:13:48 2012 -0600

    	PR other/54324
    	* ansidecl.h (ATTRIBUTE_UNUSED): Do not set __attribute__ for GCC
    	< 3.4.

diff --git a/include/ansidecl.h b/include/ansidecl.h
index 23d85bf..40f4a5f 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -279,8 +279,15 @@ So instead we use the macro below and test it against specific values.  */
 # endif
 #endif
 
+/* Similarly to ARG_UNUSED below.  Prior to GCC 3.4, the C++ frontend
+   couldn't parse attributes placed after the identifier name, and now
+   the entire compiler is built with C++.  */
 #ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#if GCC_VERSION >= 3004
+#  define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#else
+#define ATTRIBUTE_UNUSED
+#endif
 #endif /* ATTRIBUTE_UNUSED */
 
 /* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-18 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-18 15:18 PR other/54324: Do not set __attribute__ for GCC < 3.4 Aldy Hernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).