This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/79106] wrong source line printed in diagnostics for a translation unit
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Jan 2017 20:24:19 +0000
- Subject: [Bug preprocessor/79106] wrong source line printed in diagnostics for a translation unit
- Auto-submitted: auto-generated
- References: <bug-79106-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79106
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
That's right. I believe printing the contents of the translation unit and not
even opening the files referenced by the #line directives in it like Clang does
is the expected and correct behavior. Not just to avoid printing the contents
of unrelated files but to print the contents at all. When the local header
referenced from the translation unit isn't a close match to what is in the TU
GCC won't print any context in the diagnostics. I don't know what all it
considers to decide.
I'm not at all familiar with the GCC preprocessor implementation so I have no
idea how feasible it is to change it to behave that way.