This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] remove goto in c_parser_sizeof_expression
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: Prathamesh Kulkarni <bilbotheelffriend at gmail dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 25 Feb 2014 00:46:24 +0000
- Subject: Re: [C PATCH] remove goto in c_parser_sizeof_expression
- Authentication-results: sourceware.org; auth=none
- References: <CAJXstsCHg_Sh=G2rOQ5oKz+-dXBzYY_y0n2tad7mRoq6BsujfQ at mail dot gmail dot com> <20140222181444 dot GJ10901 at redhat dot com> <CAJXstsDRb_1Vj7XUtEpfmNkKxAFc0xW7SsFW0oxm7GAm_jX+DQ at mail dot gmail dot com> <20140222194827 dot GK10901 at redhat dot com> <CAJXstsBLdYg59RteokN4ULqYjOgq-W6cHx6VVwFoND7YnfCswQ at mail dot gmail dot com> <20140224175853 dot GB16545 at redhat dot com> <CAJXstsAnabDH+uj2QCq=yJi1FYHW5cRY9eUONHDjDwgZhvHpEg at mail dot gmail dot com> <20140224192823 dot GC16545 at redhat dot 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