delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/07/12/12:15:13

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: Interrupt 33 and format warnings
To: acmq AT alpha DOT coe DOT ufrj DOT br
Date: Tue, 12 Jul 94 8:45:37 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Mailer: Elm [revision: 70.85]

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019