This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/84195] newlines in deprecated diagnostics


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]