This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32448] [3.3 / 3.4 / 4.1 / 4.2 / 4.3 Regression] abs / printf bug
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jun 2007 12:26:13 -0000
- Subject: [Bug c/32448] [3.3 / 3.4 / 4.1 / 4.2 / 4.3 Regression] abs / printf bug
- References: <bug-32448-13830@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from ubizjak at gmail dot com 2007-06-22 12:26 -------
(In reply to comment #8)
> I'll work on some debugging and see if I can find out how it derives the value
> of "i" that it prints differently each time.
Don't worry, it works correctly.
The non-problem you are going after is in printf(). It takes variable arguments
from the stack and interprets them according to the format string. Argument are
pushed to the stack by the caller without any other communication with callee,
so it is obvious that format string _must_ reflect the type of values on stack.
Also note, that %f inherently converts float type to double, so your values on
the stack are FUBAR as far as printf is concerned.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32448