This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] Remove uses of ATTRIBUTE_UNUSED in the function parameters
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 11 Sep 2012 11:53:03 -0500
- Subject: Re: [C++ Patch] Remove uses of ATTRIBUTE_UNUSED in the function parameters
- References: <504F58C8.5050502@oracle.com> <20120911153732.GU22619@tucnak.redhat.com>
On Tue, Sep 11, 2012 at 10:37 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Sep 11, 2012 at 05:29:12PM +0200, Paolo Carlini wrote:
>> PS: slightly interesting, in a couple of cases -
>> write_unnamed_type_name, wrap_cleanups_r - the parameters were
>> actually used.
>
> Just a general comment, often an argument is only conditionally used,
> e.g. depending on some preprocessor macro (e.g. target hook). In that
> case unnamed parameter is not an option, but dropping ATTRIBUTE_UNUSED is
> not desirable either.
That a parameter is unused in a function body should be clear from the context.
And in those case, it is desirable that the parameter be unnamed, and
the attribute
be dropped. That is what Paolo's patch is doing. That should not be
controversial.
-- Gaby