From: | Hans-Peter Diettrich <DrDiettrich1@aol.com> |
Newsgroups: | comp.compilers |
Date: | 25 Sep 2006 01:13:56 -0400 |
Organization: | Compilers Central |
References: | 06-09-02906-09-042 06-09-048 06-09-060 06-09-078 06-09-093 06-09-108 06-09-117 |
Keywords: | parse, C |
Posted-Date: | 25 Sep 2006 01:13:56 EDT |
Chris Dollin wrote:
>>#defined names, and the parser adds all encountered typedef names. This
>>procedure works fine, provided that typedefs always have global scope,
>>as is required in C.
>
>
> Not so far as I'm aware: I couldn't find such a restriction for C90,
> and could find implications in the text that it would be allowed.
C99 states that type declarations are not allowed in C procedure
definitions.
> Experimentally, `gcc -ansi -pedantic` was quite happy with a typedef
> inside `main`.
The standard may differ between C and C++.
What gcc does, that's another story ;-)
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.