Hello,

this patch adds the ARG_UNUSED() macro to be used in place of
ATTRIBUTE_UNUSED.  The syntax looks like this:

	void foo (int ARG_UNUSED (x))
	{
	} 

The C++ frontend can't parse attribute((unused)) when it
appears after the variable name (GCC < 3.4).  The cleanest
work-around is using the standard C++ syntax to specify unused
parameters, which can also be used when bootstrapping from
other C++ compilers.

This patch is a pre-requisite for the upcoming C++ bootstrap
patches that I've been preparing.


include/
2004-07-24  Bernardo Innocenti  <bernie@develer.com>

	* ansidecl.h (ARG_UNUSED): New Macro.

Index: include/ansidecl.h
===================================================================
RCS file: /cvs/gcc/gcc/include/ansidecl.h,v
retrieving revision 1.16
diff -u -p -r1.16 ansidecl.h
--- include/ansidecl.h	17 Jun 2003 14:10:00 -0000	1.16
+++ include/ansidecl.h	23 Jul 2004 21:49:51 -0000
@@ -264,6 +264,14 @@ So instead we use the macro below and te
 #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
 #endif /* ATTRIBUTE_UNUSED */
 
+/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
+   identifier name.  */
+#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
+# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
+#else /* !__cplusplus || GNUC >= 3.4 */
+# define ARG_UNUSED(NAME) NAME
+#endif /* !__cplusplus || GNUC >= 3.4 */
+
 #ifndef ATTRIBUTE_NORETURN
 #define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
 #endif /* ATTRIBUTE_NORETURN */
