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

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #4)
> What follows the percent sign must one of the C or POSIX conversion
> specifiers (after any optional flags etc.) and those are all single byte
> characters in most (all?) charsets.  In %x\x1B$B" (in the test case from
> PR33748) the \x1B character is the beginning of an ISO-2022 escape sequence
> and not a valid conversion specifier so I think it's fine, even correct, to
> only consider it as the (invalid) conversion specifier, print it in the
> warning, and restart parsing with the byte after it.  Treating what follows
> % as a sequence of multibyte characters could otherwise throw off the
> remaining parsing.

To be honest, the support for utf8 and multi-byte encodings is so poor right
now, that I don't think this is the most pressing issue, but note that the
warning message is exactly the same for "%ñ" and "%í". The poor location info
would not help to find where the problem is. 

<source>: In function 'void foo(int)':
<source>:3:23: warning: unknown conversion type character '\xd1' in format
[-Wformat=]
3 |      __builtin_printf("%i%і%𝚒%ℹ", i);
  |                       ^~~~~~~~~~~~~~~~
<source>:3:23: warning: unknown conversion type character '\xf0' in format
[-Wformat=]
<source>:3:23: warning: unknown conversion type character '\xe2' in format
[-Wformat=]

Reply via email to