From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Daniel Marjamäki" <daniel.marjamaki@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Improve syntax error
Date: Thu, 10 Jan 2019 10:39:00 -0000 [thread overview]
Message-ID: <20190110103941.GT14180@gate.crashing.org> (raw)
In-Reply-To: <CAMabPZTrZCY73+80z+LW6b2ZDLNHb7-rWN51vuoY2vE0v896Zg@mail.gmail.com>
On Sat, Jan 05, 2019 at 06:02:08PM +0100, Daniel Marjamäki wrote:
> > I think the indentation warnings should catch that?
>
> I get this:
>
> void f()
> {
> }
> } // <- error: expected identifier or '(' before '}' token
>
> I ran with -Wall -Wextra -pedantic and did not see a indentation
> warning. Am I missing some indentation warning? The error message I
> get is a little misplaced. I think it's fine to warn about that } but
> it could also say in the error message that the problem is probably
> the previous }
I opened https://gcc.gnu.org/PR88790 .
>
> > Should this say something like "expected ) or , or ;"?
>
> No none of those suggestions will solve the error.
>
> Look at this code:
>
> int x = 3) + 0;
>
> Writing a ) or , or ; will not fix the syntax error. You have to
> remove the ) or add a ( somewhere.
Yeah, I wasn't quite awake when I wrote that, apparently :-)
Segher
prev parent reply other threads:[~2019-01-10 10:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-04 20:25 Daniel Marjamäki
2019-01-05 8:50 ` Segher Boessenkool
2019-01-05 17:02 ` Daniel Marjamäki
2019-01-05 19:44 ` Daniel Marjamäki
2019-01-08 20:29 ` Daniel Marjamäki
2019-01-08 20:44 ` Joseph Myers
2019-01-10 10:39 ` Segher Boessenkool [this message]
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=20190110103941.GT14180@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=daniel.marjamaki@gmail.com \
--cc=gcc@gcc.gnu.org \
/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).