-Wformat: fix nonsensical "wide character" message (PR c/84258)
commit2cc7d3a7da20bcfd854302b1f265c6551b8a3741
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 1 May 2018 18:51:15 +0000 (1 18:51 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 1 May 2018 18:51:15 +0000 (1 18:51 +0000)
tree6a4fbd7ff8617e1040301cc5459a55a9fbb6c517
parent41e2c1b0b4effb21729299c5dd7b3b2abd03d87b
-Wformat: fix nonsensical "wide character" message (PR c/84258)

gcc/c-family/ChangeLog:
PR c/84258
* c-format.c (struct format_check_results): Add field
"number_non_char".
(check_format_info): Initialize it, and warn if encountered.
(check_format_arg): Distinguish between wide char and
everything else when detecting arrays of non-char.

gcc/testsuite/ChangeLog:
PR c/84258
* c-c++-common/Wformat-pr84258.c: New test.

From-SVN: r259807
gcc/c-family/ChangeLog
gcc/c-family/c-format.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wformat-pr84258.c [new file with mode: 0644]