Patch for C99 mixed declarations and code

Andi Kleen ak@suse.de
Mon Nov 6 23:36:00 GMT 2000


"Joseph S. Myers" <jsm28@cam.ac.uk> writes:

> This patch adds support for mixed declarations and code in C.  The
> complexity (in the parser - it's purely a parser patch since all the
> non-parser code needed is already shared between C and C++) is largely
> due to two GCC extensions:

Very nice. I've been waiting for that for a long time :-)

> 
> * Labels at end of compound statements (which seems to be why
> ends_in_label was there, and prevented stmts from expanding to a
> series of lineno_labeled_stmt - with the optional trailing labels
> extension at the end - because that would lead to a parser conflict).
> (This extension seems gratuitous - using a null statement is trivial,
> so it just serves to encourage nonportable (possibly unintentionally
> so) code.  This extension also seems to be undocumented - perhaps the
> pedwarn should become mandatory?)

Or just remove it from the grammer. Although I know a few users I think
they can be all trivially fixed.


-Andi


More information about the Gcc-patches mailing list