https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98819
Bug ID: 98819 Summary: -Wall -Wformat-signedness suggests %u for %u Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jg at jguk dot org Target Milestone: --- Reproduced in latest Godbolt trunk %u is suggested for %u #1 with x86-64 gcc (trunk) <source>: In function 'int main()': <source>:6:19: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'int' [-Wformat=] 6 | std::printf("%u", CURRENT_YEAR); | ~^ | | | unsigned int | %u Compiler returned: 0 #include <cstdio> #define CURRENT_YEAR 2021 int main() { std::printf("%u", CURRENT_YEAR); }