Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000129 [cparser] preprocessor minor have not tried 2013-11-29 03:22 2014-02-14 11:19
Reporter luzero View Status public  
Assigned To
Priority low Resolution open  
Status confirmed   Product Version
Summary 0000129: #if defined(foo) && foo triggers a warning
Description Obviously it should not.
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000195)
Matze (administrator)
2014-01-10 14:18

I can't reproduce this. (I'm on cparser d733932b2e0a1d82f8af03a375d8bd0d8210f812). With or without --no-external-pp.
(0000201)
luzero (reporter)
2014-02-09 06:30

Figured out why, -Wundef seems too eager.
(0000204)
Matze (administrator)
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.

- Issue History
Date Modified Username Field Change
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


Mantis 1.1.5[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker