__LINE__
Arthur David Olson
ado at elsie.UUCP
Tue Mar 4 03:15:28 AEST 1986
My April 30, 1985 Draft standard has a "conceptual model" on page 5 that
breaks language processing into these successive phases (among others):
. . .
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, in discussing the preprocessor, the standard reads:
. . .The line number of the current source line is one greater than
the number of new-line characters read while processing the source
file to the current token. . .The predefined macro name __LINE__
has the value of the line number of the current source line
(a decimal constant). . .
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?
--
UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado at seismo.ARPA
DEC, VAX and Elsie are Digital Equipment and Borden trademarks
More information about the Comp.lang.c
mailing list