This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [libiberty] Add ARG_UNUSED as a C++-friendly replacement for ATTRIBUTE_UNUSED
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: bernie at develer dot com (Bernardo Innocenti)
- Cc: gcc-patches at gcc dot gnu dot org (GCC Patches), gdb-patches at sources dot redhat dot com, binutils at sources dot redhat dot com, ian at wasabisystems dot com (Ian Lance Taylor), dj at redhat dot com (DJ Delorie)
- Date: Mon, 12 Jul 2004 00:19:52 -0400 (EDT)
- Subject: Re: [libiberty] Add ARG_UNUSED as a C++-friendly replacement for ATTRIBUTE_UNUSED
>
> 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 <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/
>
>
>