This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch for C99 mixed declarations and code


"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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]