From owner-freebsd-chat Sat Sep 5 18:57:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA08213 for freebsd-chat-outgoing; Sat, 5 Sep 1998 18:57:59 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA08206 for ; Sat, 5 Sep 1998 18:57:58 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.1/8.9.1) id VAA21373; Sat, 5 Sep 1998 21:56:43 -0400 (EDT) (envelope-from wollman) Date: Sat, 5 Sep 1998 21:56:43 -0400 (EDT) From: Garrett Wollman Message-Id: <199809060156.VAA21373@khavrinen.lcs.mit.edu> To: Charles Youse Cc: Dusk Auriel Sykotik , chat@FreeBSD.ORG Subject: Re: Where can I find C In-Reply-To: References: Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org < said: [Redirected to the correct list.] > Nah, it'll draw a warning, perhaps .... but this is perfectly legal C. >> You can't use printf(), you didn't include stdio.h :) Mr. Whazisname is correct. Standard C does not permit variadic functions to be called without a declaration in scope. The minimal hello, world program in C would be: ------------------------------------ int printf(const char *, ...); /* supply correct prototype */ int main(void) /* as a special exception, main is allowed to take no args */ { printf("Hello, World!\n"); return 0; /* main MUST return a value if it returns at all */ } ------------------------------------ I don't recall whether a non-prototype declaration is permitted for variadic functions. I think it is, but would not be surprised to see non-prototype declarations dropped completely from C 99. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message