This is the mail archive of the 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: [Patch to gcc/function] PR 58362

On Mon, Sep 9, 2013 at 4:46 AM, Jakub Jelinek <> wrote:
> On Mon, Sep 09, 2013 at 11:45:08AM +0200, Richard Biener wrote:
>> Well, in this case the patch should IMHO be a no-op.
>> -      warning (OPT_Wunused_parameter, "unused parameter %q+D", decl);
>> +      warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wunused_parameter,
>> +               "unused parameter %qD", decl);
>> no?  Unless I misunderstand what %q+D should do.
> The question is how exactly is %q+D defined, if it is
> warning_at (location_of (decl), OPT_Wunused_parameter, "unused parameter %qD", decl); in this case, or
> DECL_SOURCE_LOCATION (decl) instead.

The semantics of '%+D' was defined long before I got involved.

The way it was supposed to work is that we pick the location
of the decl being specified, instead of taking the current
location.  When we figured that was insufficient, we introduced
%H to say: pick this location.  For that reason, one can only have
on +D in a diagnostic message (I don't think we

-- Gaby

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