• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is there a warning for "Called function with no prototype"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Is there a warning for "Called function with no prototype"?
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: ZeroLink: unknown symbol '_mysql_init' <-- architecture ppc does not match cputype
  • Next by Date: Re: Is there a warning for "Called function with no prototype"?
  • Previous by thread: Re: Xcode-users Digest, Vol 3, Issue 428
  • Next by thread: Re: Is there a warning for "Called function with no prototype"?
  • Index(es):
    • Date
    • Thread