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: Miles Bader <miles at gnu dot org>
- To: Chris Lattner <clattner at apple dot com>
- Cc: Georg-Johann Lay <avr at gjlay dot de>, gcc at gcc dot gnu dot org
- Date: Mon, 30 Jan 2012 13:21:37 +0900
- Subject: Re: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'
- References: <4F25BA74.9000008@gjlay.de> <02481925-2E17-4B6E-A29D-871EC7C9B8C2@apple.com>
Chris Lattner <clattner@apple.com> writes:
>> 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)
gcc 4.6 (and later) produces a more reasonable message:
$ gcc-4.6 -c e.c
e.c:1:1: error: unknown type name âIntâ
I suspect the OA has an older version of gcc...
-Miles
--
80% of success is just showing up. --Woody Allen