Ticket #262 (Fixed)Tue Jan 18 22:10:30 UTC 2011
CC's preprocessor needlessly warns about undefined macros
Reported by: | David Thomas (43) | Severity: | Normal |
Part: | RISC OS: C/C++ toolchain | Release: | |
Milestone: | Status | Fixed |
Details by David Thomas (43):
For example with this line from pngconf.h:
- if (defined(MWERKS) && ((MWERKS < 0×0900) || macintosh))
CC generates the warnings:
Undefined macro ‘MWERKS’ in #if – treated as 0 Undefined macro ‘macintosh’ in #if – treated as 0The initial expression defined(MWERKS) is clearly there to short-circuit the check but CC seems to carry on regardless, parsing the rest of the tokens and complaining about them. This is not what you’d expect given the behaviour of C’s && operator.
This isn’t the language proper so perhaps this behaviour is undefined. In any case it’s odd and results of lots of throwback spam.
Changelog:
Modified by Jeffrey Lee (213) Sun, November 02 2014 - 14:15:26 GMT
- Status changed from Open to Fixed
Warning can now be suppressed via new -wz option in CC 5.71 (DDE 25)