https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70114

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
On Mon, 7 Mar 2016, tanzx940228 at hotmail dot com wrote:

> 3.gcc.error.c
> -------------
> int main() {
>     {
>         int foo(float arg0, float arg1);
>         foo(3.0f, 4.0f);
>     }
>     {
>         foo(3.0f, 4.0f); // clang passes, gcc gets an error???
>     }
> }
> 
> This is really weird! Clang gives me a warning saying that I'm using an
> out-of-scope prototype. BUT gcc gives me an error, saying "incompatible
> implicit declaration of function ‘foo’"! What happened?

An unprototyped function type is never compatible with a function 
prototype with argument types subject to the default argument promotions, 
such as float.  See C90 6.5.4.3 (reference to C90 since you're using 
implicit declarations).

Reply via email to