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

            Bug ID: 80003
           Summary: i386.c: %s placeholder is no semantic grammar unit
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: translation
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roland.illig at gmx dot de
  Target Milestone: ---

from config/i386/386.c:

error ("interrupt service routine should have unsigned %s"
       "int as the second argument",
       TARGET_64BIT
       ? (TARGET_X32 ? "long long " : "long ")
       : "");

The placeholder %s is attached to the "int" following it without a space. This
looks suspicious, and indeed the sentence is hard to understand for
translators. It should rather look like this:

error ("interrupt service routine should have %qs "
       "as the second argument",
       TARGET_64BIT && TARGET_X32 ? "unsigned long long int"
       : TARGET_64_BIT ? "unsigned long int"
       : "unsigned int");

In this form the translator doesn't have to care about the contents of the %qs
placeholder, since it won't affect the enclosing sentence. Also, the code now
clearly and unambiguously names the exact types (as a semantic unit) instead of
a list of type keywords.

Reply via email to