Mail Archives: djgpp/1994/07/12/12:15:13
Antonio Carlos M. de Queiroz writes:
> Why gcc prints warnings when I use %lf, %le, and %lg formats to
> print doubles?
With printf, the "l" modifier is used only to specify "long integer"
vs. "integer". An "l" before any thing other than "d", "i", "o", "u",
"x", or "X" (or "n"?) is ignored. This is the warning you are getting.
Floating point numbers passed to printf are already assumed to be
doubles; they are automatically promoted from float to double when
passed, if necessary.
This is different than scanf, which assumes "float" and requires an
"l" to specify "double".
--
Eric Backus
ericb AT lsid DOT hp DOT com
(206) 335-2495
- Raw text -