www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/21/20:25:56

From: Dag Nummedal <nummedal AT pvv DOT unit DOT no>
Date: Mon, 21 Nov 94 19:11:57 +0100
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: printf or floating point error?????
References: <01HJPW9XYKJ6004CV7 AT VAX1 DOT ROCKHURST DOT EDU>

Aaron Ucko writes:
 > [major deletion]
 > >Oh, and my aplogies to the original poster.  The compiler seems to be
 > >broken.
 > 

Actually the original poster was totally correct.  While DJGPP allows you to
use long doubles (10 byte), printf can't handle them, so you have to cast to
double before printing.

This problem has popped up several times, and I haven't seen any fixes for
it. 

(It may have been fixed recently, in which case I apologize for slandering
DJGPP, without rechecking the facts.)

 > Which one?  TC seems to be the broken compiler from what I've read...it also
 > fails to compile correctly the following (admittedly ridiculous) program:
 > 
 > int main()
 > {
 >   float f=3//* // should only start a comment in C++ */5;

To be able to compile under a c++ compiler (or at least with c++ comments),
the semicolon should be put on the next line.

Also I'm pretty sure I've seen a switch to disable these comments in TC.

 >   if(f>2) puts("This compiler fails to compile legal C code");
 >   else puts("This compiler works the way it should");
 >   return f>2;
 > }
 > 

-Dag Nummedal

- Raw text -


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