c-common.c (FMT_FLAG_ARG_CONVERT, [...]): Define.
authorJoseph Myers <jsm28@cam.ac.uk>
Sun, 8 Oct 2000 21:12:33 +0000 (22:12 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sun, 8 Oct 2000 21:12:33 +0000 (22:12 +0100)
commit2588e44e0019aac9b55c974efd69885eea663f54
tree6f49f847180526c3c7d7a8d59f55017486fd803d
parent7fd9a5168344bc1d3621e263412e587d79969091
c-common.c (FMT_FLAG_ARG_CONVERT, [...]): Define.

* c-common.c (FMT_FLAG_ARG_CONVERT, FMT_FLAG_SCANF_A_KLUDGE,
FMT_FLAG_FANCY_PERCENT_OK): Define.
(format_char_info): Add flag "4" to comment.
(format_flag_spec, format_flag_pair): New structures.
(format_kind_info): Add additional fields to control format
checking.
(printf_flag_specs, printf_flag_pairs, scanf_flag_specs,
scanf_flag_pairs, strftime_flag_specs, strftime_flag_pairs): New
arrays.
(time_char_table): Use "4" flag to handle %Ey.
(format_types): Add entries for new fields.
(get_flag_spec): New function.
(check_format_info): Increase size of flag_chars[] to 256.
Control format checking using the new fields of a format_kind_info
and the new tables; remove all conditionals on printf_format_type,
scanf_format_type or strftime_format_type.  Handle all details of
bad combinations of flags (including width, precision and strftime
modifiers) through data rather than ad hoc code.  Handle all
details of standard versions in which flags appeared through
data.  Use the "4" flag.

testsuite:
* gcc.dg/c90-printf-1.c, gcc.dg/c90-scanf-1.c,
gcc.dg/c99-printf-1.c, gcc.dg/c99-scanf-1.c,
gcc.dg/c99-strftime-1.c, gcc.dg/format-ext-3.c: Adjust error
regexps and details of expected handling of some bad formats.
* gcc.dg/format-xopen-1.c: Add test for $ format with assignment
suppression.

From-SVN: r36790
gcc/ChangeLog
gcc/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/c90-printf-1.c
gcc/testsuite/gcc.dg/c90-scanf-1.c
gcc/testsuite/gcc.dg/c99-printf-1.c
gcc/testsuite/gcc.dg/c99-scanf-1.c
gcc/testsuite/gcc.dg/c99-strftime-1.c
gcc/testsuite/gcc.dg/format-ext-3.c
gcc/testsuite/gcc.dg/format-xopen-1.c