Re: How are stdlib.h and time.h imported?
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