Jan Nieuwenhuizen <[email protected]> writes:
> Hi Matt!
>
> When I use Nyacc to parse things like
>
> #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
> # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
> #else
> # define _GL_ATTRIBUTE_PURE /* empty */
> #endif
>
> I get
>
> foo.c:1: undefined identifier: "__GNUC__"
> foo.c:1: CPP error
This looks like a problem in Nyacc. Within the condition of an "#if" or
"#elif" preprocessor form, after macro expansion is performed, all
remaining identifiers are replaced with 0. See section 6.10.1
(Conditional inclusion) paragraph 4 of C99.
Mark