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: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2007 05:06:00 -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 #11 from kargl at gcc dot gnu dot org 2007-06-23 05:06 -------
(In reply to comment #10)
> (In reply to comment #9)
> > Don't worry, it works correctly.
> > ...
> > 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.
>
> That is "working correctly" ?!?
>
> Very well, but not so obvious.
>
>
> _IF_ we had "argflaps" (taken from the word "mudflaps") we could get printf (or
> any other function) to type-check the variable on the stack (or anywhere!) at
> run-time and compare it to what it "thought" it should be. This could be a very
> powerful feature - but lack of it is not a bug :( .
>
(1) Try -Wformat
(2) Send a patch that implements your argflaps
(3) There is an expectation someone writing C might actually
adhere to the Standard
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32448