Re: -Wformat and u8""

2022-05-09 Thread Andreas Schwab
On Mai 09 2022, Florian Weimer via Gcc wrote: > * 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); >> |^ > > Th

Re: -Wformat and u8""

2022-05-09 Thread Ulrich Drepper via Gcc
On Mon, May 9, 2022 at 11:26 AM Florian Weimer wrote: > On the other hand, that cast is still quite ugly. Yes, there aren't yet any I/O functions defined for char8_t and therefore that's the best we can do right now. I have all kinds of ugly macros to high these casts. > All string-related >

Re: GSoC Fortran - Do Concurrent

2022-05-09 Thread Thomas Schwinge
Hi Bryan! Thanks for reaching out, and welcome to GCC! On 2022-05-03T13:34:13-0500, Bryan Carroll via Gcc wrote: > I know I'm too late for GSoC, but if Tobias Burnus or someone wants to > mentor me, I'm willing to work on the Fortran - Do Concurrent project, as a > volunteer, if it's not already

Re: -Wformat and u8""

2022-05-09 Thread Florian Weimer via Gcc
* 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

-Wformat and u8""

2022-05-09 Thread Ulrich Drepper via Gcc
I have a C++20+ code base which forces the program to run using an UTF-8 locale and then uses u8"" strings internally. This causes warnings with -Wformat. #include int main() { printf((const char*) u8"test %d\n", 1); return 0; } Compile with g++ -std=gnu++20 -c -O -Wall t.cc and you'll