From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20989 invoked by alias); 11 Jul 2004 23:52:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20915 invoked from network); 11 Jul 2004 23:52:32 -0000 Received: from unknown (HELO develer.com) (151.38.19.110) by sourceware.org with SMTP; 11 Jul 2004 23:52:32 -0000 Received: (qmail 10855 invoked from network); 11 Jul 2004 23:52:29 -0000 Received: from beetle.trilan (HELO ?10.3.2.254?) (?vHUTC9YI8LbUOnu3mPzS/CowRkyQzL9L?@10.3.2.254) by ns.trilan with SMTP; 11 Jul 2004 23:52:29 -0000 Message-ID: <40F1D2BD.7030808@develer.com> Date: Sun, 11 Jul 2004 23:52:00 -0000 From: Bernardo Innocenti Organization: Develer S.r.l. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040625 MIME-Version: 1.0 To: GCC Patches , gdb-patches@sources.redhat.com, binutils@sources.redhat.com, Ian Lance Taylor , DJ Delorie Subject: [libiberty] Add ARG_UNUSED as a C++-friendly replacement for ATTRIBUTE_UNUSED Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-07/txt/msg00104.txt.bz2 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 * 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/