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: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Oct 2017 21:58:15 +0000
- Subject: [Bug preprocessor/58687] "#line __LINE__ ..." changes subsequent line numbers
- Auto-submitted: auto-generated
- References: <bug-58687-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58687
--- Comment #28 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Well, I also think the existing choice is the more natural choice for the
value of __LINE__ in this case (#line is mainly for use by code
generators, which can always count lines and specify the desired number
when changing the filename). And the note on the patch "Note that this
solution is not robust; hiding the __LINE__ reference inside another macro
will bypass this special case test." indicates changing the choice is not
so simple after all (having a choice of line number that depends on
whether __LINE__ is inside another macro seems even less natural).