This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Only allow __label__ at the beginning of compound statements as documented (PR c++/32121)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Andreas Schwab <schwab at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 10 Oct 2007 21:00:19 -0700
- Subject: Re: [C++ PATCH] Only allow __label__ at the beginning of compound statements as documented (PR c++/32121)
- References: <20070927140718.GS2625@devserv.devel.redhat.com> <je4phg41ug.fsf@sykes.suse.de> <20070927153357.GT2625@devserv.devel.redhat.com>
Jakub Jelinek wrote:
> So do I need to write:
>
> /* Parse a compound-statement.
>
> compound-statement:
> { statement-seq [opt] }
>
> GNU extension:
>
> compound-statement:
> { label-declaration-seq [opt] statement-seq [opt] }
>
> label-declaration-seq:
> label-declaration
> label-declaration-seq label-declaration
>
> Returns a tree representing the statement. */
Yes.
And the patch is OK with that change. I'm sympathetic to Tom's idea
that the beginning-of-block restriction is artificial, and I'm concerned
about backwards-compatibility -- but as this feature exists primarily
for compatibility with GNU C and as I'm not at all confident we handle
the difficult middle-of-block cases correctly, I think this is OK.
However, if reports come in of this causing problems, we will need to
reconsider.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713