This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/58687] "#line __LINE__ ..." changes subsequent line numbers
- From: "mtewoodbury at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Nov 2013 04:52:01 +0000
- Subject: [Bug preprocessor/58687] "#line __LINE__ ..." changes subsequent line numbers
- Auto-submitted: auto-generated
- References: <bug-58687-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58687
--- Comment #21 from Max TenEyck Woodbury <mtewoodbury at gmail dot com> ---
(In reply to Joseph S. Myers from comment #20)
> Suspending pending a DR since I think the present code is correct and while
> the standard is ambiguous I think the interpretation here strains the
> wording of the standard. I'd proposed to close this if a DR (or other WG14
> document) isn't under consideration at the Parma meeting of WG14.
A 'DR' is not necessary and is unlikely to be submitted. The ambiguity
referred
to is in the expansion of macros, not in the processing of directives.
The elaborate description of the different forms of the '#line' (and other)
directives makes it clear that <pp-token> expansion is not to take place until
after the <end-of-line> for the directive has been seen.
Accepted usage is for '#line __LINE__' to leave the line numbering unchanged.
Any other interpretation would require some form of expression evaluation in
order to leave line numbering unchanged; a possibility that has been rejected.