14 Mar
2002
14 Mar
'02
9:47 p.m.
the native code generator was passing the Float as a C float on the stack, but snprintf() expects a double. Half-remembering that C specifies that floats should be promoted to doubles in function call arguemts, I modified the NCG to do just this. But the C standard doesn't say this - it says that floats are promoted to doubles only for
(a) functions without an ANSI prototype, and (b) vararg functions, for args after the "...".
Ha. So that explains why it sort-of worked before, since the promotion doesn't happen if there is a prototype. Well spotted. How absolutely horrible. Why do the C people have such a bizarre set of rules? J