]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add %[zt][diox] support to pretty-print
authorJakub Jelinek <jakub@redhat.com>
Sat, 10 Feb 2024 10:27:14 +0000 (11:27 +0100)
committerJakub Jelinek <jakub@redhat.com>
Sat, 10 Feb 2024 10:27:14 +0000 (11:27 +0100)
commit8427290f33d95bc173d37637fbec044b2c067f14
treeb62fb847f0b9e06ba10c7ab4c448820baaafb0b7
parent89e93ce8b9a6e5d5ee2d6c469b3bc8c9b62ef579
Add %[zt][diox] support to pretty-print

In the previous patch I haven't touched the gcc diagnostic routines,
using HOST_SIZE_T_PRINT* for those is obviously undesirable because we
want the strings to be translatable.  We already have %w[diox] for
HOST_WIDE_INT arguments, this patch adds t and z modifiers for those.

2024-02-10  Jakub Jelinek  <jakub@redhat.com>

gcc/
* pretty-print.cc (pp_integer_with_precision): Handle precision 3 for
size_t and precision 4 for ptrdiff_t.  Formatting fix.
(pp_format): Document %{t,z}{d,i,u,o,x}.  Implement t and z modifiers.
Formatting fixes.
(test_pp_format): Test t and z modifiers.
* gcc.cc (read_specs): Use %td instead of %ld and casts to long.
gcc/c-family/
* 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.
gcc/fortran/
* error.cc (error_print): Handle z and t modifiers on d, i and u.
* check.cc (gfc_check_transfer): Use %zd instead of %ld and casts to
long.
* primary.cc (gfc_convert_to_structure_constructor): Use %td instead
of %ld and casts to long.
gcc/c-family/c-format.cc
gcc/fortran/check.cc
gcc/fortran/error.cc
gcc/fortran/primary.cc
gcc/gcc.cc
gcc/pretty-print.cc