* Ulrich Drepper via Gcc:

> t.cc: In function ‘int main()’:
> t.cc:5:24: warning: format string is not an array of type ‘char’ [-Wformat=]
>     5 |   printf((const char*) u8"test %d\n", 1);
>       |                        ^~~~~~~~~~~~~

This is not an aliasing violation because of the exception for char,
right?  So the warning does not even highlight theoretical undefined
behavior.

On the other hand, that cast is still quite ugly.  All string-related
functions in the C library currently need it.  It might obscure real
type errors.  Isn't this a problem with char8_t?

Thanks,
Florian

Reply via email to