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 12/10/2010 12:11 PM, Dodji Seketeli wrote:
> [dodji@adjoa gcc]$ ./cc1 -quiet -ftrack-macro-expansion test.c
> test.c: In function âgâ:
> test.c:5:14: error: invalid operands to binary<<  (have âdoubleâ and âintâ)
> In macro 'OPERATE' at test.c:2:9
>      Expanded at test.c:5:3
> In macro 'SHIFTL' at test.c:5:14
>      Expanded at test.c:8:3
> In macro 'MULT' at test.c:8:3
>      Expanded at test.c:13:3
> 

I'm not sure I share Jeff's doubts about the location to present.
Possibly _this_ could be controlled by a flag, though.

Also, I know this is just an RFC, but the error message should
probably look like either this example:

test.c:5:14: error: invalid operands to binary<<  (have âdoubleâ and âintâ)
test.c:2:9: note: in expansion of macro 'OPERATE'
test.c:5:3: note: expanded from here
test.c:5:14: note: in expansion of macro 'SHIFTL' 
test.c:8:3: note: expanded from here
test.c:8:3: note: in expansion of macro 'MULT'
test.c:13:3: note: expanded from here

or this shorter example:

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

or this that does not change the location compared to current GCC:

test.c:13:3: 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'

Paolo


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