From Bugzilla Helper: User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.2.16-22smp i686) I think the following program should compile with no warnings: float foo(float x) { return (x); } int main(void) { float y = 0.0f; y = foo(y); return 0; } But: gcc -g -Wall -Wconversion foo.c foo.c: In function `main': foo.c:10: warning: passing arg 1 of `foo' as `float' rather than `double' due to prototype Reproducible: Always Steps to Reproduce: Just compile the above program with -Wconversion. Actual Results: gcc gives that weird warning. Expected Results: Since there is no double in the program, I would expect the program to compile without warnings.
That warning is correct: `-Wconversion' Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype. ... If you had no prototype and foo was defined elsewhere, main would pass it a double not a float (that's what default argument promotion rules say), so you get the warning.