__LINE__

Joseph S. D. Yao jsdy at hadron.UUCP
Fri Mar 14 15:02:26 AEST 1986


In article <6037 at elsie.UUCP> ado at 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 at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.lang.c mailing list