aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2025-02-25 20:03:38 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2025-02-25 20:03:38 +0100
commit0bb431d0a77cf8dc790b9c61539b3eb6ab1710f0 (patch)
tree9f4980c85e80f8ad6a637ef328f932265623e8de
parent1b9e4fe2ff5f4711406cdcf0e6e183b247d9f42b (diff)
downloadgcc-0bb431d0a77cf8dc790b9c61539b3eb6ab1710f0.zip
gcc-0bb431d0a77cf8dc790b9c61539b3eb6ab1710f0.tar.gz
gcc-0bb431d0a77cf8dc790b9c61539b3eb6ab1710f0.tar.bz2
pru: Fix pru_pragma_ctable_entry diagnostics [PR118991]
HOST_WIDE_INT_PRINT* macros aren't supposed to be used in gcc-internal-format format strings, we have the w modifier for HOST_WIDE_INT in that case, the HOST_WIDE_INT_PRINT* macros might not work properly on some hosts (e.g. mingw32 has HOST_LONG_LONG_FORMAT "I64" and that is something pretty-print doesn't handle, while it handles "ll" for long long) and also the use of macros in the middle of format strings breaks translations (both that exgettext can't retrieve the string from there and we get #: config/pru/pru-pragma.cc:61 msgid "%<CTABLE_ENTRY%> index %" msgstr "" #: config/pru/pru-pragma.cc:64 msgid "redefinition of %<CTABLE_ENTRY %" msgstr "" in po/gcc.pot and also the macros are different on different hosts, so even if exgettext extracted say "%<CTABLE_ENTRY%> index %lld is not valid" it could be translated on some hosts but not e.g. mingw32). So, the following patch just uses %wd instead. Tested it before/after the patch on #pragma ctable_entry 12 0x48040000 #pragma ctable_entry 1024 0x48040000 #pragma ctable_entry 12 0x48040001 and the result is the same. 2025-02-25 Jakub Jelinek <jakub@redhat.com> PR translation/118991 * config/pru/pru-pragma.cc (pru_pragma_ctable_entry): Use %wd instead of %" HOST_WIDE_INT_PRINT "d to print a hwi in error.
-rw-r--r--gcc/config/pru/pru-pragma.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/config/pru/pru-pragma.cc b/gcc/config/pru/pru-pragma.cc
index 9c182d7..c3f3d33 100644
--- a/gcc/config/pru/pru-pragma.cc
+++ b/gcc/config/pru/pru-pragma.cc
@@ -58,11 +58,9 @@ pru_pragma_ctable_entry (cpp_reader *)
if (type != CPP_EOF)
error ("junk at end of %<#pragma CTABLE_ENTRY%>");
else if (i >= ARRAY_SIZE (pru_ctable))
- error ("%<CTABLE_ENTRY%> index %" HOST_WIDE_INT_PRINT "d"
- " is not valid", i);
+ error ("%<CTABLE_ENTRY%> index %wd is not valid", i);
else if (pru_ctable[i].valid && pru_ctable[i].base != base)
- error ("redefinition of %<CTABLE_ENTRY "
- "%" HOST_WIDE_INT_PRINT "d%>", i);
+ error ("redefinition of %<CTABLE_ENTRY %wd%>", i);
else
{
if (base & 0xff)