This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch to gcc/function] PR 58362
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Jakub Jelinek <jakub at redhat dot com>, 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>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Mon, 9 Sep 2013 07:51:55 -0500
- Subject: Re: [Patch to gcc/function] PR 58362
- Authentication-results: sourceware.org; auth=none
- References: <522CCF1B dot 8080007 at oracle dot com> <alpine dot LNX dot 2 dot 00 dot 1309090945470 dot 3869 at zhemvz dot fhfr dot qr> <522D8BBC dot 608 at oracle dot com> <alpine dot LNX dot 2 dot 00 dot 1309091132340 dot 3869 at zhemvz dot fhfr dot qr> <alpine dot LNX dot 2 dot 00 dot 1309091136460 dot 3869 at zhemvz dot fhfr dot qr> <20130909094311 dot GG1817 at tucnak dot redhat dot com> <alpine dot LNX dot 2 dot 00 dot 1309091144200 dot 3869 at zhemvz dot fhfr dot qr> <20130909094634 dot GH1817 at tucnak dot redhat dot com> <alpine dot LNX dot 2 dot 00 dot 1309091203460 dot 3869 at zhemvz dot fhfr dot qr>
On Mon, Sep 9, 2013 at 5:04 AM, Richard Biener <rguenther@suse.de> wrote:
> On Mon, 9 Sep 2013, 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.
>
> It can't be 'location_of' because that's a C++ FE speciality but
> warning_at and %q+D are diagnostic machinery level.
%+D was, and has for long, been a C++ FE-specific marker.
I don't recall when we decided to make that available to all front-ends.
> Unless of course the meaning of %q+D depends on the frontend which
> would make its use from the middle-end ill-defined.
We introduced xxx_at so that a different locus (different from the
decl and different from current locus, if ever defined) can be specified.
-- Gaby