Date: Mon, 7 Sep 1998 09:53:17 +0930 From: Greg Lehey <grog@lemis.com> To: Jens Schweikhardt <schweikh@noc.dfn.de>, Charles Youse <cyouse@artemis.syncom.net> Cc: syko@sykotik.org, scott@iprg.nokia.com, daniel@cooltime.simplenet.com, freebsd-chat@FreeBSD.ORG Subject: Re: Where can I find C Message-ID: <19980907095317.L25397@freebie.lemis.com> In-Reply-To: <199809061040.MAA17606@obsidian.noc.dfn.de>; from Jens Schweikhardt on Sun, Sep 06, 1998 at 12:40:06PM %2B0200 References: <Pine.NEB.3.96.980905204054.25315A-100000@artemis.syncom.net> <199809061040.MAA17606@obsidian.noc.dfn.de>
next in thread | previous in thread | raw e-mail | index | archive | help
(redirected to -chat)
On Sunday, 6 September 1998 at 12:40:06 +0200, Jens Schweikhardt wrote:
> # On Sat, 5 Sep 1998, Dusk Auriel Sykotik wrote:
> # > On Fri, 4 Sep 1998, Scott Sewall wrote:
> # > > main () {
> # > > printf("Hello World!\n");
> # > > }
> # > You can't use printf(), you didn't include stdio.h :)
>
> hello, world\n
>
> # Nah, it'll draw a warning, perhaps .... but this is perfectly legal C.
>
> What did you smoke tonight? :-)
K&R fiirst edition?
> You call a variadic function with no prototype in scope
> which leads to undefined behaviour as per ISO 9899:1990
> This bombs as soon as the representation of int and char *
> are different or if there are different passing mechanisms
> for those types.
You're obviously very young, or you place too much trust in
``standards''. The *very* first program in "The C programming
language", by Brian W. Kernighan and Dennis M. Ritchie, first edition
(1978), page 6, is:
main()
{
printf("hello, world\n");
}
That's all. No header files, no comments. Purists will note that the
the braces are not in K&R style (they are in the previous example),
that the message is lower case only and does not bang.
> Note that only the spelling of hello, world\n as above is correct :-)
I didn't think it was standardized.
Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980907095317.L25397>
