Is there a warning for "Called function with no prototype"?
Is there a warning for "Called function with no prototype"?
- Subject: Is there a warning for "Called function with no prototype"?
- From: Jerry Krinock <email@hidden>
- Date: Fri, 16 Jun 2006 18:33:16 -0700
- Thread-topic: Is there a warning for "Called function with no prototype"?
I called a C function, defined in another file, which had had some float
parameters, and returned a float. But I forgot to #include or #import the
header which declared the function.
It appears when Xcode/gcc compiled this file, it cordially assumed that this
function was going to be defined, and that these parameters of were,
probably, ints. Anyhow, when the thing ran, the floats got passed and the
result was garbage.
Explicity typecasting the floats in the call did no help. It took me most
of the afternoon to figure this out, and actually I remember having a
similar problem a few weeks ago. In that case I gave up and used a
different function!
Is there a warning I can turn on to catch this error? I tried "Missing
Function Prototypes" but that warns when undeclared functions are *defined*.
I want a warning when undeclared functions are *called*.
Jerry Krinock
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden