• 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
Re: How are stdlib.h and time.h imported?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How are stdlib.h and time.h imported?


  • Subject: Re: How are stdlib.h and time.h imported?
  • From: "Clark Cox" <email@hidden>
  • Date: Tue, 21 Aug 2007 06:51:19 -0700

On 8/20/07, Karsten <email@hidden> wrote:
> it did so in 10.3 i believe... you could write c apps without
> including <stdio.h> even though you used printf. as of 10.4 you have
> to include it explicitly though

No. This is not true; and has never been true. You were just getting
lucky (or unlucky as the case may be), as C (before C99) allowed
implicit declarations of functions, so the compiler would assume that
any function that was called without a prototype had the signature:

int foo()

However, calling a function in such a way whose signature doesn't
match that is undefined behavior according to the C standard (i.e.
don't do it). In C99, that is no longer legal, and the compiler will
balk at such code.

> Am 21.08.2007 um 08:03 schrieb Andrew Farmer:
>
> > On 20 Aug 07, at 23:51, Boris Remizov wrote:
> >> Its standard behavior of gcc and other compilers. It looks in the
> >> well known places for header (eg. /usr/include ) and static
> >> libraries (/usr/lib) automatically.
> >
> > That is very emphatically not the case. While /usr/include is on
> > the default system header search path, gcc will not include any
> > headers unless you specifically direct it to do so by including
> > them, or including headers which include them.
> >
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>


--
Clark S. Cox III
email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How are stdlib.h and time.h imported? (From: "Frank Bettger" <email@hidden>)
 >Re: How are stdlib.h and time.h imported? (From: Boris Remizov <email@hidden>)
 >Re: How are stdlib.h and time.h imported? (From: Andrew Farmer <email@hidden>)
 >Re: How are stdlib.h and time.h imported? (From: Karsten <email@hidden>)

  • Prev by Date: Re: DashBoard Help
  • Next by Date: Re: How are stdlib.h and time.h imported?
  • Previous by thread: Re: How are stdlib.h and time.h imported?
  • Next by thread: NSTokenField, Bindings and Pasteboard Operations
  • Index(es):
    • Date
    • Thread