Mail Archives: djgpp/2000/08/10/02:36:10
On Wed, 9 Aug 2000, Lets Go Canes! wrote:
> gcc -Wconversion -c test.c
> test.c: In function `main':
> test.c:11: warning: passing arg 1 of `f' as `float' rather than `double' due to prototype
> test.c:11: warning: passing arg 2 of `f' with different width due to prototype
These are the warnings you asked for with -Wconversion. The essense of
the warning is this: GCC tells you that any code which does not have the
prototype visible at compile time will work incorrectly.
The reason is that C, by default, promotes all float variables to double
and all char variables to int, when passing them to functions.
To make those warnings go away, change the definition of `f' so that it
accepts double and int rather than float and char. Then the code will
work even without the prototype.
- Raw text -