K
Keith Thompson
Jordan Abel said:It produces undefined behavior. For example, it would be reasonable for
a pure c89 printf implementation to use the same internal flag for l and
L.
C90 specifically says that "%lf" invokes undefined behavior.
C99 says that the 'l' in "%lf" has no effect.
IMHO this is similar to the C99 rule that falling off the end of
main() is equivalent to executing "return 0;"; it causes some
previously undefined code to become defined, but is not helpful for
code that was correct in the first place.
There is no good reason to use "%lf" rather than "%f".