Originally Posted By: jcl
- The %f placeholder in printf expects var/double, not float! Look here: http://manual.zorro-trader.com/printf.htm

If a C function expects a var and you pass a float instead, it's normally automatically converted and you need not bother. Not so with printf: It has no fixed variable types. So you must always pass the correct type that is expected for the placeholder. Otherwise you'll get garbage.

Umm, float is automatically promoted to double in variadic arguments (just as char and short are promoted to int). At least, according to the C standard. Since variadic arguments aren't supported in Lite-C directly, but it's still there for support with external languages, I would have assumed that the compiler conforms to type promotion rules?


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com