From: Bernardo Innocenti <bernie@develer.com>
To: Bernd Schmidt <bernds@redhat.com>
Cc: Richard Henderson <rth@redhat.com>,
Andrew Pinski <pinskia@physics.uc.edu>,
GCC Patches <gcc-patches@gcc.gnu.org>,
gdb-patches@sources.redhat.com, binutils@sources.redhat.com,
Ian Lance Taylor <ian@wasabisystems.com>,
DJ Delorie <dj@redhat.com>
Subject: Re: [libiberty] Add ARG_UNUSED as a C++-friendly replacement for ATTRIBUTE_UNUSED
Date: Tue, 13 Jul 2004 22:45:00 -0000 [thread overview]
Message-ID: <40F465EA.3090703@develer.com> (raw)
In-Reply-To: <Pine.LNX.4.56.0407132255170.4658@hades.cambridge.redhat.com>
Bernd Schmidt wrote:
> On Tue, 13 Jul 2004, Richard Henderson wrote:
>>On Tue, Jul 13, 2004 at 09:50:36AM +0200, Bernardo Innocenti wrote:
>>
>>#ifdef __cplusplus
>># define ARG_UNUSED(N)
>>#elif somegccversion
>># define ARG_UNUSED(N) N ATTRIBUTE_UNUSED
>>#else
>># define ARG_UNUSED(N) N
>>#endif
>
> That fails in cases where the argument is unused only on some targets
> and needed by others.
For those (few) cases, I've handled it by moving ATTRIBUTE_UNUSED
before the typename, which seems to work G++ 3.3 too.
> What's wrong with just disabling ATTRIBUTE_UNUSED for compilers that
> can't handle it?
- You get lots of annoying warnings in stage1 and when building
a cross compiler;
- If we switch to C++, ARG_UNUSED would allow using the standard
C++ syntax for unused arguments;
- libiberty.h is used in other projects and it's about portability
across different compilers and platforms. The ATTRIBUTE_UNUSED
macro cannot be made to work usefully with all compilers,
therefore it must be replaced with something more portable;
- "int ARG_UNUSED(foo)" is shorter, more readable and sexier than
"int foo ATTRIBUTE_UNUSED".
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/
next prev parent reply other threads:[~2004-07-13 22:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-11 23:52 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 [this message]
2004-07-12 14:01 ` Andrew Cagney
2004-07-12 19:09 ` DJ Delorie
2004-07-13 8:05 ` Bernardo Innocenti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40F465EA.3090703@develer.com \
--to=bernie@develer.com \
--cc=bernds@redhat.com \
--cc=binutils@sources.redhat.com \
--cc=dj@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sources.redhat.com \
--cc=ian@wasabisystems.com \
--cc=pinskia@physics.uc.edu \
--cc=rth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox