This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'
Miles Bader wrote:
> 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...
Ya, with a freshly built 4.7 the message is really good now, but with a slight
different typo the message is still there:
Int 2 foo (void)
{
return 1;
}
or here:
int foo 1(void)
{
return 1;
}
So the pain-to-the-eyes diagnose is still hanging around in the sources of
GNU C (GCC) version 4.7.0 20120130 (experimental) (avr)
Johann
>
> -Miles
>
- References:
- expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'
- Re: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'
- Re: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo'