public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Marek Polacek <polacek@redhat.com>
Cc: Prathamesh Kulkarni <bilbotheelffriend@gmail.com>,
	<gcc-patches@gcc.gnu.org>
Subject: Re: [C PATCH] remove goto in c_parser_sizeof_expression
Date: Tue, 25 Feb 2014 00:46:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1402250041580.14141@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20140224192823.GC16545@redhat.com>

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

  reply	other threads:[~2014-02-25  0:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 17:04 Prathamesh Kulkarni
2014-02-22 17:06 ` Prathamesh Kulkarni
2014-02-22 18:14 ` Marek Polacek
2014-02-22 18:49   ` Prathamesh Kulkarni
2014-02-22 19:48     ` Marek Polacek
2014-02-24 17:38       ` Prathamesh Kulkarni
2014-02-24 17:59         ` Marek Polacek
2014-02-24 18:31           ` Prathamesh Kulkarni
2014-02-24 19:28             ` Marek Polacek
2014-02-25  0:46               ` Joseph S. Myers [this message]
2014-02-25  6:17               ` Jeff Law
2014-04-24 21:33               ` Jeff Law
2014-04-25  7:38                 ` Marek Polacek
2014-05-01 23:57                   ` Joseph S. Myers
2014-05-02  5:18                   ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1402250041580.14141@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=bilbotheelffriend@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).