This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'
- From: Chris Lattner <clattner at apple dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 29 Jan 2012 15:43:27 -0800
- Subject: Re: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'
- References: <4F25BA74.9000008@gjlay.de>
On Jan 29, 2012, at 1:30 PM, Georg-Johann Lay wrote:
> Hi,
>
> may I propose to change this message to a more user-friendly one?
>
> In most cases, the message is triggered by a typo like here:
>
> Int foo (void)
> {
> return 1;
> }
>
> A message like
>
> error: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'
>
> is just pain to the eyes, and apart from that it is not more helpful than a simple "syntax error before 'foo':
FWIW, Clang produces:
t.c:1:1: error: unknown type name 'Int'; did you mean 'int'?
Int foo (void)
^
http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html
:)
-Chris