[Mingw-w64-public] mingw-w64 and __attribute__((format(printf))) issue
Thu May 7 04:09:22 GMT 2020
在 2020/5/6 18:48, Martin Storsjö 写道:
> So something like this should work:
> #ifdef __MINGW32__
> #define PRINTF_FORMAT __MINGW_PRINTF_FORMAT
> #define PRINTF_FORMAT printf
> Not very pretty, but should work without hardcoding any assumptions
> about which format actually is used.
This requires `#include <stdio.h>` first.
Also I don't think it is correct to check for `__MINGW32__` for this
purpose, as the original MinGW.org header doesn't seem to provide
However a direct check for `__MINGW_PRINTF_FORMAT` should suffice .
It is building well now, albeit still with some minor warnings:
../../gcc-git/lto-plugin/lto-plugin.c:927:29: note: format string is
927 | sscanf (s, ".%" PRI_LL "x", &obj->out->id);
| unsigned int *
| %" PRI_LL "llx
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the Gcc-help