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.
Showing
- gcc/c-family/c-format.cc 7 additions, 5 deletionsgcc/c-family/c-format.cc
- gcc/fortran/check.cc 2 additions, 2 deletionsgcc/fortran/check.cc
- gcc/fortran/error.cc 59 additions, 1 deletiongcc/fortran/error.cc
- gcc/fortran/primary.cc 6 additions, 6 deletionsgcc/fortran/primary.cc
- gcc/gcc.cc 12 additions, 18 deletionsgcc/gcc.cc
- gcc/pretty-print.cc 57 additions, 10 deletionsgcc/pretty-print.cc
Loading
Please register or sign in to comment