https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66077
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Mike Jost from comment #2) > Thanks for the explanation! Bit by the 64 bit. That will teach me to use > uint32_t instead of assuming 32 for unsigned long. I've been running on 32 > bit embedded targets for too long! Or compile your code with -Wformat or simply -Wall, like the bug reporting instructions say. How can we make this even clearer? Perhaps some big, red, blinking text would help? ;-) test.c:18:5: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] printf("x = 0x%X\n", x); ^ test.c:19:5: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] printf("y = 0x%X\n", y); ^