Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: net.lang.c Subject: Re: __LINE__ Message-ID: <302@hadron.UUCP> Date: Fri, 14-Mar-86 00:02:26 EST Article-I.D.: hadron.302 Posted: Fri Mar 14 00:02:26 1986 Date-Received: Sat, 15-Mar-86 22:49:28 EST References: <6037@elsie.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 27 Keywords: __LINE__ Summary: Passing NL info along? In article <6037@elsie.UUCP> ado@elsie.UUCP (Arthur David Olson) writes: >My April 30, 1985 Draft standard has a "conceptual model" ... > 2. Each instance of a new-line character and an immediately > preceding baclslash character is deleted, splicing > physical source lines to form logical source lines. > . . . > 5. The source is preprocessed. . . >Later, > . . .The predefined macro name __LINE__ > has the value of the line number of the current source line... >It's unclear (to me, at least) whether the new-line characters that are >counted in determining __LINE__ are those in the physical source lines >(seen in conceptual phase 2) or those in the logical source lines >(seen in conceptual phase 5, the preprocessing phase). I'd imagine that >having __LINE__ be a physical source line number would be preferable, >but how can that be accomplished without breaking down barriers between >conceptual phases? I'd suggest that the info about where in the logical text stream the various lines start could be saved in a structure passed in parallel with the "logical" source. This is not a new idea: think about how sdb and dbx know about where in the compiled code (surely less strictly related to the physical source than the logical source) various physical source code lines start. -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}