delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/07/13/08:14:36

Date: Wed, 13 Jul 94 08:12:34 EST
From: acmq AT alpha DOT coe DOT ufrj DOT br (Antonio Carlos Moreirao de Queiroz)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: format warnings

Hi,

Try the code:

#include <stdio.h>

void main(void)
{
  double x;
  x=1000;
  printf("x=%lg\n",x);
}

Compiling with gcc -Wall prog.c I get a warning about using "l" with "g" when
printing a double. Really, as Eric Backus points out, K&R does not say anything
about the "l" prefix when printing doubles. The "info" program says that it
is to be used with the meaning of "L" for long doubles (?). The on line help
of Borland C says clearly that "l" with "e","f", or "g" is to be used when
printing a double (and it does not complain).

Antonio Carlos M. de Queiroz

- Raw text -


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