public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug translation/93836] teach xgettext what HOST_WIDE_INT_PRINT means
       [not found] <bug-93836-4@http.gcc.gnu.org/bugzilla/>
@ 2021-10-28  2:37 ` egallager at gcc dot gnu.org
  2021-10-28 15:20 ` msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: egallager at gcc dot gnu.org @ 2021-10-28  2:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93836

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |egallager at gcc dot gnu.org,
                   |                            |msebor at gcc dot gnu.org

--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Roland Illig from comment #2)
> Thanks for the explanation. I think it might make sense to have a static
> analysis tool for cases like this, to prevent this mistake from the
> beginning, or at least be notified quickly, before the translators have to
> write bug reports. It's not the first time I saw this kind of bug. :)

Maybe Martin Sebor can add a check for it in -Wformat-diag?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translation/93836] teach xgettext what HOST_WIDE_INT_PRINT means
       [not found] <bug-93836-4@http.gcc.gnu.org/bugzilla/>
  2021-10-28  2:37 ` [Bug translation/93836] teach xgettext what HOST_WIDE_INT_PRINT means egallager at gcc dot gnu.org
@ 2021-10-28 15:20 ` msebor at gcc dot gnu.org
  2021-10-28 15:22 ` msebor at gcc dot gnu.org
  2021-11-02  9:49 ` marxin at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-10-28 15:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93836

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-10-28

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
The -Wformat checkers can't detect using the HOST_WIDE_INT_PRINT because by the
time they run macros have been expanded and adjacent string literals
concatenated.  They can only detect this problem when compiling for the targets
with the unsupported format directives (like %I64d), which I would expect they
already do.

The problem could be detected by some script, maybe the one that scrapes the
format strings out of the sources and generates the gcc.pot file.  IMO, a good
time to do this is either during bootstrap, or during make check, regardless of
the target.

Anyway, the problematic code is still there in GCC 12(see below) so confirmed.

          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);
          else if (pru_ctable[i].valid && pru_ctable[i].base != base)
            error ("redefinition of %<CTABLE_ENTRY "
                   "%" HOST_WIDE_INT_PRINT "d%>", i);
          else
            {
              if (base & 0xff)
                warning (0, "%<CTABLE_ENTRY%> base address is not "
                            "a multiple of 256");
              pru_ctable[i].base = base;
              pru_ctable[i].valid = true;
            }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translation/93836] teach xgettext what HOST_WIDE_INT_PRINT means
       [not found] <bug-93836-4@http.gcc.gnu.org/bugzilla/>
  2021-10-28  2:37 ` [Bug translation/93836] teach xgettext what HOST_WIDE_INT_PRINT means egallager at gcc dot gnu.org
  2021-10-28 15:20 ` msebor at gcc dot gnu.org
@ 2021-10-28 15:22 ` msebor at gcc dot gnu.org
  2021-11-02  9:49 ` marxin at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-10-28 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93836

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mliska at suse dot cz

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Martin, do I recall right that you have a script that checks message strings
for some problems?  If yes, does it detect this problem or could it be enhanced
to detect it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translation/93836] teach xgettext what HOST_WIDE_INT_PRINT means
       [not found] <bug-93836-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-10-28 15:22 ` msebor at gcc dot gnu.org
@ 2021-11-02  9:49 ` marxin at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-02  9:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93836

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #5)
> Martin, do I recall right that you have a script that checks message strings
> for some problems?  If yes, does it detect this problem or could it be
> enhanced to detect it?

We have the following script contrib/check-internal-format-escaping.py written
by Roland.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-02  9:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93836-4@http.gcc.gnu.org/bugzilla/>
2021-10-28  2:37 ` [Bug translation/93836] teach xgettext what HOST_WIDE_INT_PRINT means egallager at gcc dot gnu.org
2021-10-28 15:20 ` msebor at gcc dot gnu.org
2021-10-28 15:22 ` msebor at gcc dot gnu.org
2021-11-02  9:49 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).