This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] Remove uses of ATTRIBUTE_UNUSED in the function parameters


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]