K&R-style function declarations aren't quite the same as modern style ones. In particular, the default argument promotions take place, making your float
parameter not quite legal. You have two choices to fix your problem:
Change
fun
to accept adouble
parameter instead of afloat
.Change the definition of
fun
to a standard-C-style function definition:int fun(float aa) { return aa; }
I also removed the unnecessary cast & parentheses.
As an aside, if you are a beginner, you might find clang helpful - it sometimes provides much better error messages. For your program, for example:
example.c:13:7: warning: promoted type 'double' of K&R function parameter is not
compatible with the parameter type 'float' declared in a previous
prototype [-Wknr-promoted-parameter]
float aa;
^
example.c:5:25: note: previous declaration is here
extern int fun(float);
^