This is the mail archive of the
mailing list for the GCC project.
Re: some strangeness with gcc 3.4.1
- From: chris jefferson <caj at cs dot york dot ac dot uk>
- To: Marty Leisner <leisner at rochester dot rr dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 11 Sep 2004 21:54:50 +0100
- Subject: Re: some strangeness with gcc 3.4.1
- References: <200409112027.i8BKRuf4002597@dell.home>
Marty Leisner wrote:
This program won't compile with gcc 3.4.1:This code shouldn't really have ever compiled, I'm suprised it did
: leisner@soyata;cat foo.c
By default if a c compiler finds a function without a prototype if tries
to guess at what it should be, and always guesses the return value is
int. Therefore in this case it guesses bar's prototype is "int
bar(void)", which obviously conflicts with what you later define.
The correct way to fix this is to define bar before using it (which
really you should do anyway.