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]
Other format: [Raw text]

Re: [C PATCH] remove goto in c_parser_sizeof_expression


On Mon, 24 Feb 2014, Marek Polacek wrote:

> On Tue, Feb 25, 2014 at 12:01:25AM +0530, Prathamesh Kulkarni wrote:
> > Replaced tab by 4 spaces before error_at.
> > * c-parser.c (c_parser_sizeof_expression): Remove goto sizeof_expr.
> 
> Looks good now, but I can't approve it.  Thanks,

I think all the discussion here has been missing a key point: what is the 
rationale for the patch?  I think the explicit control flow is clearer 
here than making code appear unconditional at the end of the function for 
what is in fact just one of the two equal cases (expressions and types) 
for this function (the handling of types having returned earlier).

Effectively, this really is conceptually "at first this looks like sizeof 
(type), but later it turns out to be sizeof expression, so we need to 
recover from having already parsed (type)", and the goto reflects that 
concept of how this parse works.

-- 
Joseph S. Myers
joseph@codesourcery.com


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