How to use `__attribute __ ((format (printf, x, y)))` for Unicode characters for C11 U "?

I am porting the application with char* for anything and everywhere to use UCS4, as this is an internal Unicode representation. I use C11 U"unicode literals" to define strings that expand to char32_t arrays that are essentially uint32_t .

The challenge is to properly annotate printf functions. Since the "format" is no longer char* , the compiler refuses to compile it further, nor will he be happy with char32_t * instead of char * for the %s format, I suppose.

I am not dependent on the stdlib *printf family at all, so formatting is done exclusively according to my implementation.

What is the right solution for this, except to completely disable this attribute?

+5
source share
1 answer

There is currently no way in GCC to do this. This is a known bug, see GCC Error 64862

+1
source

Source: https://habr.com/ru/post/1206188/


All Articles