On 2/13/24 01:26, Jakub Jelinek wrote:
On Mon, Feb 12, 2024 at 04:10:33PM +0000, Joseph Myers wrote:
On Sat, 10 Feb 2024, Jakub Jelinek wrote:
* c-format.cc (gcc_diag_length_specs): Add t and z modifiers.
(PP_FORMAT_CHAR_TABLE, gcc_gfc_char_table): Add entries for t and
z modifiers.
Please also add some tests of format checking for these modifiers in
gcc.dg/format/gcc_*.c.
The following patch does that.
Haven't added tests for bad type (but I think we don't have them in
c99-printf* either) for these because it is hard to figure out what
type from {,unsigned }{int,long,long long} size_t/ptrdiff_t certainly
is not, guess one could do that with preprocessor conditionals, e.g.
comparing __PTRDIFF_MAX__ with __INT_MAX__, __LONG_MAX__ and
__LONG_LONG_MAX__ and pick up the one which is different; but we'd need
to find out corresponding effective targets for the expected diagnostics.
Tested on x86_64-linux and i686-linux, ok for trunk?
2024-02-13 Jakub Jelinek <ja...@redhat.com>
* gcc.dg/format/gcc_diag-1.c (foo): Add tests for z and t modifiers.
* gcc.dg/format/gcc_gfc-1.c (foo): Add tests for ll, z and t modifiers.
OK.
jeff