Date: Mon, 7 Sep 1998 10:58:47 +0930 From: Greg Lehey <grog@lemis.com> To: Marc Slemko <marcs@znep.com>, jack <jack@germanium.xtalwind.net> Cc: freebsd-chat@FreeBSD.ORG Subject: Re: Where can I find C Message-ID: <19980907105847.D583@freebie.lemis.com> In-Reply-To: <Pine.GSO.4.02A.9809061801290.9882-100000@redfish>; from Marc Slemko on Sun, Sep 06, 1998 at 06:04:03PM -0700 References: <Pine.BSF.4.02A.9809062048330.3596-100000@germanium.xtalwind.net> <Pine.GSO.4.02A.9809061801290.9882-100000@redfish>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, 6 September 1998 at 18:04:03 -0700, Marc Slemko wrote: > On Sun, 6 Sep 1998, jack wrote: > >> In the second edition (1988) `#include <stdio.h>' is part of that >> listing, and it is in that brace style. However, the include >> file is not required. >> >> germanium:jack {116} echo 'main(){printf("Hello World!\n");}' > >> hello.c >> germanium:jack {117} cc -o hello hello.c >> germanium:jack {118} ./hello >> Hello World! >> germanium:jack {119} cc -v >> gcc version 2.7.2.1 >> >> No warning, no errors, no core dumps. > > Just because it works on an implementation without problems or just > because it was "standard" at one point does not mean that current > standards allow it or that an implementation must work in that manner. True. But that has nothing to do with the original question. > So the issue is if the most relevant C standard says you need the > include, then it isn't C if you don't do it even if it compiles. That's your interpretation. If you read the compiler documentation, you'll see that it supports multiple standards. By default, this program works fine, and I claim that it's still C: === grog@freebie (/dev/ttyp0) ~ 2 -> cat >hello.c main() { printf("hello, world\n"); } You have mail in /var/mail/grog === grog@freebie (/dev/ttyp0) ~ 3 -> cc hello.c -o hello === grog@freebie (/dev/ttyp0) ~ 4 -> ./hello hello, world === grog@freebie (/dev/ttyp0) ~ 5 -> 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?19980907105847.D583>