Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.lang.c Subject: Re: How about a predefined #FILE, #PATH and #FUNCTION for C? Message-ID: <3198@sun.uucp> Date: Tue, 28-Jan-86 02:41:58 EST Article-I.D.: sun.3198 Posted: Tue Jan 28 02:41:58 1986 Date-Received: Thu, 30-Jan-86 01:13:41 EST References: <312@yale.ARPA <887@h-sc1.UUCP> Organization: Sun Microsystems, Inc. Lines: 18 > I cannot claim to speak about other versions of unix, but in Berkeley > 4.2 and 4.3, there are two macros automatically defined for you by the > c preprocessor: __FILE__ and __LINE__. ... > > Could someone on a non-4.2/4.3 BSD machine tell us if this facility is > part of other preprocessors as well? Thanks. This facility was added to the C preprocessor by John Reiser at Bell Labs; it first appeared outside the Labs in V7. It is, therefore, in V7 and all post-V7 UNIX systems except those where the supplier decided to "improve" it by supplying a C compiler which doesn't support it - let's hope there aren't any such systems. It's even documented in the System V "cpp" manual page, along with the "defined()" operator. I believe that both __FILE__ and __LINE__, as well as "defined()", are in the ANSI C draft standard. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy%gorodish@sun.arpa (yes, really)