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 3/6] Emit macro expansion related diagnostics


On Tue, Dec 14, 2010 at 1:19 AM, Dodji Seketeli <dodji@redhat.com> wrote:
> Paolo Bonzini <bonzini@gnu.org> writes:
>
>>
>> test.c:5:14: error: invalid operands to binary<< ?(have ‘double’ and ‘int’)
>> test.c:2:9: note: while expanding macro 'OPERATE'
>> test.c:5:14: note: while expanding macro 'SHIFTL'
>> test.c:8:3: note: while expanding macro 'MULT'
>> test.c:13:3: note: expanded from here
>>
>
> In the absence of caret diagnostic I think it is useful to explicitely
> make the difference between a location in the definition of the macro,
> and the location of the macro expansion point, i.e:

Agreed.  But I also agree with Paolo's observation: the prefix "<locus>: note"
has to precede the diagnostic message.  I know there are other compilers
that do it differently, but GCC convention has been to precede diagnostics
with loci -- until we move to 2-dimensional diagnostic display (what
is sometimes
referred to as diagnostics with carets).

-- Gaby


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