From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10934 invoked by alias); 12 Jul 2004 04:20:05 -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 10900 invoked from network); 12 Jul 2004 04:20:03 -0000 Received: from unknown (HELO physunc.phy.uc.edu) (129.137.4.6) by sourceware.org with SMTP; 12 Jul 2004 04:20:03 -0000 Received: from tin.geop.uc.edu (tin.geop.uc.edu [10.44.11.213]) by physunc.phy.uc.edu (8.9.3p2/8.9.3) with ESMTP id AAA00386; Mon, 12 Jul 2004 00:19:52 -0400 (EDT) Received: (from pinskia@localhost) by tin.geop.uc.edu (8.11.6/8.9.3) id i6C4Jq318362; Mon, 12 Jul 2004 00:19:52 -0400 From: Andrew Pinski Message-Id: <200407120419.i6C4Jq318362@tin.geop.uc.edu> Subject: Re: [libiberty] Add ARG_UNUSED as a C++-friendly replacement for ATTRIBUTE_UNUSED To: bernie@develer.com (Bernardo Innocenti) Date: Mon, 12 Jul 2004 04:20:00 -0000 Cc: gcc-patches@gcc.gnu.org (GCC Patches), gdb-patches@sources.redhat.com, binutils@sources.redhat.com, ian@wasabisystems.com (Ian Lance Taylor), dj@redhat.com (DJ Delorie) In-Reply-To: <40F1D2BD.7030808@develer.com> from "Bernardo Innocenti" at Jul 12, 2004 01:52:29 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-07/txt/msg00105.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. Huh? Yes it can from 3.4.0 and above. Thanks, Andrew Pinski who is just going through emails from the last two days > > > 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/ > > >