[Bug c/11307] Random printf values under different optimization levels.
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Tue Jun 24 17:22:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11307
------- Additional Comments From bangerth at dealii dot org 2003-06-24 16:23 -------
Why do people not learn to include the proper function declarations?
Including stdio.h and running gcc with -W -Wall would have said
tmp/gg> gcc -c x.c -W -Wall
x.c:2: warning: return type defaults to `int'
x.c: In function `main':
x.c:7: warning: double format, different type arg (arg 2)
x.c:8: warning: double format, different type arg (arg 3)
x.c:9: warning: control reaches end of non-void function
Which is not surprising given this call
printf( "n, s: %f, %f\n", n, s );
with n being an integer. Everything that comes after that is at an
unexpected position on the stack and will be wrong, of course.
W.
More information about the Gcc-bugs
mailing list