https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85948
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2018-09-16 CC| |manu at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- This works for me with all versions I have tried starting with GCC 6.1 (only in C). In GCC 8.1: <source>:13:11: error: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Werror=format=] str_fmt("%s %zu %s %s", d, str, str, d); ~^ ~ %d <source>:13:15: error: format '%zu' expects argument of type 'size_t', but argument 3 has type 'const char *' [-Werror=format=] str_fmt("%s %zu %s %s", d, str, str, d); ~~^ ~~~ %s <source>:13:21: error: format '%s' expects argument of type 'char *', but argument 5 has type 'int' [-Werror=format=] str_fmt("%s %zu %s %s", d, str, str, d); ~^ ~ %d It doesn't work in C++.