gcc:
commitc99a98bce7070743c9b3248b716ee7cad187fc36
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 2010 09:42:58 +0000 (13 09:42 +0000)
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Nov 2010 09:42:58 +0000 (13 09:42 +0000)
tree0d06eb7663647344d99ac555d7388b17cb2e52a6
parent6f0e79809c868fee93888369abd8f153df47b100
gcc:
2010-11-13  Paolo Bonzini  <bonzini@gnu.org>

* c-format.c (enum format_specifier_kind, kind_descriptions): New.
(struct format_wanted_type): Replace field "name" with "kind", add
"format_start" and "format_length".
(check_format_info_main): Fill in new fields.  Fill in
FORMAT_WANTED_TYPES even for missing arguments.  Move checks
after the final NUL outside the while loop.  Do not include
width and precision modifiers in the format_start/format_length
of the main format.
(check_format_types): Remove FORMAT_START and FORMAT_LENGTH
arguments.  Compute WANTED_TYPE first so that format_type_warning
can be called for missing arguments.  Adjust calls to
format_type_warning.
(format_type_warning): Fetch as much information as possible
from format_wanted_type.  Adjust printing now that every
warning has a "descr", as well as for missing argument warnings
and to include % sign for format specifiers.

testsuite:
2010-11-13  Paolo Bonzini  <bonzini@gnu.org>

* gcc.dg/format/few-1.c: New test.
* gcc.dg/format/asm_fprintf-1.c: Adjust.
* gcc.dg/format/c90-scanf-1.c: Adjust.
* gcc.dg/format/cmn-err-1.c: Adjust.
* gcc.dg/format/dfp-printf-1.c: Adjust.
* gcc.dg/format/dfp-scanf-1.c: Adjust.
* gcc.dg/format/gcc_diag-1.c: Adjust.
* gcc.dg/format/ms_unnamed-1.c: Adjust.
* gcc.dg/format/strfmon-1.c: Adjust.
* gcc.dg/format/unnamed-1.c: Adjust.
* gcc.dg/format/xopen-2.c: Adjust.
* g++.dg/ext/builtin4.C: Adjust.
* g++.dg/ext/builtin5.C: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166698 138bc75d-0d04-0410-961f-82ee72b054a4
18 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/c-family/c-format.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/builtin4.C
gcc/testsuite/g++.dg/ext/builtin5.C
gcc/testsuite/gcc.dg/format/asm_fprintf-1.c
gcc/testsuite/gcc.dg/format/c90-printf-1.c
gcc/testsuite/gcc.dg/format/c90-scanf-1.c
gcc/testsuite/gcc.dg/format/cmn-err-1.c
gcc/testsuite/gcc.dg/format/dfp-printf-1.c
gcc/testsuite/gcc.dg/format/dfp-scanf-1.c
gcc/testsuite/gcc.dg/format/few-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/format/gcc_diag-1.c
gcc/testsuite/gcc.dg/format/ms_unnamed-1.c
gcc/testsuite/gcc.dg/format/strfmon-1.c
gcc/testsuite/gcc.dg/format/unnamed-1.c
gcc/testsuite/gcc.dg/format/xopen-2.c