This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/84195] newlines in deprecated diagnostics
- 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: Mon, 05 Feb 2018 17:12:42 +0000
- Subject: [Bug c/84195] newlines in deprecated diagnostics
- Auto-submitted: auto-generated
- References: <bug-84195-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84195
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
I noticed it while comparing how GCC handles embedded control characters in
different contexts, in some of the tests I was developing. Some of the
contexts I looked at are:
1) #error and #warning where the string is printed as it appears in the source
(i.e., with escape sequences),
2) -Wformat where control characters are escaped,
3) -Wformat-overflow where control characters are not escaped unless
-fexec-charset= is specified. I consider it a bug and plan to fix it.
I think control characters should not be allowed to make it into the output in
any context. Besides breaking up diagnostics they can also mess up the color
highlighting. I suspect that when they are a part of a string it's more likely
by accident than by design, either because the same string is used for
different things (e.g., in printf in addition to attribute deprecated), or
because the repercussions aren't fully understood by the author.