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

            Bug ID: 90117
           Summary: Replace %<%s%> with %qs
           Product: gcc
           Version: 9.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: ---

In most cases %<%s%> is equivalent to the simpler %qs, therefore the latter
should be used consistently.

Surprisingly there is one exception in error.c, which is already well
documented:

  /* We have to use "%<%s%>" rather than "%qs" here in order to avoid
     quoting colorization bytes within the results.  */
  pp_printf (&tmp_pp, "%<%s%>", content);

The 17 other occurrences of %<%s%> look like the respective author just didn't
know about %qs. These should be changed to the simpler %qs.

A linter check should be added so that future code doesn't introduce the same
inconsistency. I had already reported some similar issues in 2017, and I don't
want to do that again in 2020.

Reply via email to