------- Comment #6 from jakub at gcc dot gnu dot org 2009-10-22 16:12 ------- If you bothered to use -Wall, you would see. /tmp/x.c:13:3: warning: format â%llxâ expects type âlong long unsigned intâ, but argument 2 has type âintâ /tmp/x.c:14:3: warning: format â%llxâ expects type âlong long unsigned intâ, but argument 2 has type âlong unsigned int:40â /tmp/x.c:15:3: warning: format â%llxâ expects type âlong long unsigned intâ, but argument 2 has type âintâ
All 3 are undefined behavior, but on i386 when pushing an int argument means pushing 32-bit value and reading 64-bit value means reading 2 32-bit values from the stack, you can clearly understand that the upper 32 bits aren't initialized, are whatever happened to be on the stack. In your case those are the bits from the earlier push. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41793