This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/77521] %qc format directive should quote non-printable characters
- 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: Fri, 09 Sep 2016 23:12:42 +0000
- Subject: [Bug c/77521] %qc format directive should quote non-printable characters
- Auto-submitted: auto-generated
- References: <bug-77521-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77521
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Fri Sep 9 23:12:10 2016
New Revision: 240059
URL: https://gcc.gnu.org/viewcvs?rev=240059&root=gcc&view=rev
Log:
PR c/77520 - wrong value for extended ASCII characters in -Wformat message
PR c/77521 - %qc format directive should quote non-printable characters
gcc/c-family/ChangeLog:
PR c/77520
PR c/77521
* c-format.c (argument_parser::find_format_char_info): Use %qc
format directive unconditionally.
gcc/ChangeLog:
PR c/77520
PR c/77521
* pretty-print.c (pp_quoted_string): New function.
(pp_format): Call it for %c and %s directives.
gcc/testsuite/ChangeLog:
PR c/77520
PR c/77521
* gcc.dg/pr77520.c: New test.
* gcc.dg/pr77521.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr77520.c
trunk/gcc/testsuite/gcc.dg/pr77521.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-format.c
trunk/gcc/pretty-print.c
trunk/gcc/testsuite/ChangeLog