This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro
- From: Jason Merrill <jason at redhat dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Nicholas Ormrod <nicholas dot ormrod at hotmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Manuel López-Ibáñez <lopezibanez at gmail dot com>, "christophe dot lyon at st dot com" <christophe dot lyon at st dot com>
- Date: Thu, 10 Jul 2014 15:28:05 -0400
- Subject: Re: [PATCH] PR preprocessor/60723 - missing system-ness marks for macro
- Authentication-results: sourceware.org; auth=none
- References: <87d2du4xsu dot fsf at redhat dot com> <53ADD6C2 dot 9030200 at redhat dot com> <877g3uo6cq dot fsf at redhat dot com> <COL129-W8177087E5B88848923A685F5010 at phx dot gbl> <871tu1fhjh dot fsf at redhat dot com> <53B9991D dot 7090401 at redhat dot com> <871ttt8l8l dot fsf at redhat dot com>
On 07/10/2014 08:13 AM, Dodji Seketeli wrote:
Jason Merrill <email@example.com> writes:
On 07/04/2014 05:13 AM, Dodji Seketeli wrote:
// preprocessed output
# 3 "test.cpp" 3 4
# 3 "test.cpp"
# 3 "test.cpp" 3 4
Yeah. For Built-in tokens that are expanded like that we only do track
their the location of their expansion, not their spelling location. So
this behaviour is expected as well.
But surely you can do something to avoid this useless line marker in
this case? A built-in token should never require a line change.
What triggers the line change is the *expansion* of the built-in macro
That is, the token "3". As the existing location tracking facility
doesn't track the locations for tokens originating from the expansion of
built-in macros, the relationship "3" -> __LINE__ is lost.
So what is the location of "3" in this case? It seems to me that it
doesn't really have its own location, and so we should be able to use
whatever the current location is and not emit a line note.