Bug#261513: My fault, implicit declaration with overflow
Hi,
I investigated a bit more my problem and found that what I expected about
fprintf and the '6' was normal behavior (ie. %f waits for a double and
strtof implicit declaration returns an int thus the 6 is lost in the call stack,
as the warning shows).
All is 'fixed' by simply changing the sample code with:
int main (void)
{
const char buf[] = "123.45";
const float f1 = (float)strtod (buf, NULL);
const float f2 = (float)strtof (buf, NULL);
fprintf (stdout, "result %f == %f and 6 == %d\n",
f1,
f2,
6);
exit (0);
}
The missing or implicit declaration remains but that's ok.
Thanks for closing this bigreport, sorry for the work.
Best regards
--
Dominique MASSONIE
Reply to: