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: [Patch to gcc/function] PR 58362


On 09/09/2013 12:41 PM, Jakub Jelinek wrote:
On Mon, Sep 09, 2013 at 12:38:46PM +0200, Paolo Carlini wrote:
On 09/09/2013 11:37 AM, Richard Biener wrote:
That said, grepping for %q+D reveals quite some uses and it looks like
all of them expect the location being used to be that of the decl passed
to the diagnostic call, not some random other location.
If the decl is *not* a PARM_DECL, I expect %q+D to be often
accurate. In fact, even when *is* a PARM_DECL what we have now is
pretty decent, because normally the location of the corresponding
FUNCTION_DECL isn't that far. The point is whether we want to be
*more* accurate and point to the specific unused parameter, for C
and C++, as clang and icc do.
I guess the primary question is why location_of special cases the PARM_DECL
and in which case it is useful to do so, and whether the number of cases (if
any) when it is useful to do so is bigger than the number of place when it
is undesirable.
I understand that. It seems to me a much bigger project and must be done for the C front-end too (I don't know the name of the equivalent of location_of, but the location is wrong for it too, there must be the equivalent of t = DECL_CONTEXT (t) for it too)

What can I tell you, I *may* be able to work on that, but not now, not for both front-ends.

Paolo.


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