Firm Bugtracker - cparser
Viewing Issue Advanced Details
129 preprocessor minor have not tried 2013-11-29 03:22 2014-02-14 11:19
luzero  
 
low  
confirmed  
open  
none    
none  
0000129: #if defined(foo) && foo triggers a warning
Obviously it should not.
Issue History
2013-11-29 03:22 luzero New Issue
2014-01-10 14:18 Matze Note Added: 0000195
2014-01-10 14:18 Matze Status new => feedback
2014-01-10 14:18 Matze Resolution open => unable to reproduce
2014-02-09 06:30 luzero Note Added: 0000201
2014-02-13 16:51 Matze Note Added: 0000204
2014-02-13 16:51 Matze Priority normal => low
2014-02-13 16:51 Matze Status feedback => confirmed
2014-02-13 16:51 Matze Resolution unable to reproduce => open
2014-02-14 11:19 Matze Summary #if defined(foo) triggers a warning => #if defined(foo) && foo triggers a warning

Notes
(0000195)
Matze   
2014-01-10 14:18   
I can't reproduce this. (I'm on cparser d733932b2e0a1d82f8af03a375d8bd0d8210f812). With or without --no-external-pp.
(0000201)
luzero   
2014-02-09 06:30   
Figured out why, -Wundef seems too eager.
(0000204)
Matze   
2014-02-13 16:51   
I had a chance to look at the real code in question, the case is a bit more tricky

#if defined(foo) && foo > 0
 // ...
#endif

gcc and clang do not emit a warning in this case. This is trickier to get right as you have to keep the information that you are dependent on a defined(foo) when you see the use of an identifier.