------- 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

Reply via email to