Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [libiberty] Add ARG_UNUSED as a C++-friendly replacement for ATTRIBUTE_UNUSED
@ 2004-07-11 23:52 Bernardo Innocenti
  2004-07-12  4:20 ` Andrew Pinski
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Bernardo Innocenti @ 2004-07-11 23:52 UTC (permalink / raw)
  To: GCC Patches, gdb-patches, binutils, Ian Lance Taylor, DJ Delorie

Hello,

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

	void foo (ARG_UNUSED (int, x))
	{
	} 

The C++ frontend can't parse attribute((unused)) when it
appears after the variable name.  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 prerequisite for the upcoming C++ bootstrap
patches that I've been preparing.


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

	* ansidecl.h (ARG_UNUSED): New Macro.

diff -u -p -r1.16 ansidecl.h
--- ansidecl.h	17 Jun 2003 14:10:00 -0000	1.16
+++ ansidecl.h	11 Jul 2004 15:38:23 -0000
@@ -312,4 +312,10 @@ So instead we use the macro below and te
 #define __extension__
 #endif
 
+#ifdef __cplusplus
+# define ARG_UNUSED(T, N)	T
+#else
+# define ARG_UNUSED(T, N)	T N ATTRIBUTE_UNUSED
+#endif
+
 #endif	/* ansidecl.h	*/

-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-07-13 22:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-11 23:52 [libiberty] Add ARG_UNUSED as a C++-friendly replacement for ATTRIBUTE_UNUSED Bernardo Innocenti
2004-07-12  4:20 ` Andrew Pinski
2004-07-13  7:50   ` Bernardo Innocenti
2004-07-13  8:12     ` Richard Henderson
2004-07-13  8:15       ` Bernardo Innocenti
2004-07-13  8:51         ` Richard Henderson
2004-07-13 17:11         ` Jason Merrill
     [not found]       ` <Pine.LNX.4.56.0407132255170.4658@hades.cambridge.redhat.com>
2004-07-13 22:45         ` Bernardo Innocenti
2004-07-12 14:01 ` Andrew Cagney
2004-07-12 19:09 ` DJ Delorie
2004-07-13  8:05   ` Bernardo Innocenti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox