From -5818537792357972980
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10f5bc,6f6e97a6fdbbf44c
X-Google-Attributes: gid10f5bc,public
X-Google-Thread: 109fba,6f6e97a6fdbbf44c
X-Google-Attributes: gid109fba,public
X-Google-Thread: 1014db,6f6e97a6fdbbf44c
X-Google-Attributes: gid1014db,public
X-Google-Thread: 1149ec,6f6e97a6fdbbf44c
X-Google-Attributes: gid1149ec,public
X-Google-Thread: f78e5,6f6e97a6fdbbf44c
X-Google-Attributes: gidf78e5,public
From: tim@handel.Princeton.EDU (Tim Hollebeek)
Subject: Re: And you thought that the Pentium bug was bad!  (Get a load of this!)
Date: 1995/06/21
Message-ID: <3s80r6$da5@cnn.Princeton.EDU>#1/1
X-Deja-AN: 104739263
references: <3s2las$1br@hustle.rahul.net> <3s7503$nmh@silver.jba.co.uk>
organization: Princeton University
newsgroups: comp.std.c,comp.std.c++,comp.lang.c,comp.lang.c++,comp.software.testing

In article <3s7503$nmh@silver.jba.co.uk>,
Jonathan de Boyne Pollard <JdeBP%utopium@jba.co.uk> wrote:
:Ronald F. Guilmette (rfg@rahul.net) wrote:
:: -------------------------------------------------------------------------
:: double d = 0.9;
::  
:: int
:: main ()
:: {
::     double d = 0.8;
::     {
::         extern double d;
::  
::         printf ("%f\n", d);
::         return 0;
::     }
:: }
:: -------------------------------------------------------------------------
::
:: This program *should* print 0.900000, and with most compilers, it does.
:
:Actually, the program as given doesn't compile.  But inserting the implied
:inclusion of <stdio.h> fixes that.  (-:  So just for the record, some more
:interesting results.
:
:Borland C++ 2.0 for OS/2         : 0.900000
:IBM VisualAge C++ 3.00 for OS/2  : 0.900000
:MetaWare High C++ 3.31a for OS/2 : 0.900000
:Watcom C++ 10.0b on OS/2         : 0.800000
:EMX C++ 0.9a on OS/2             : 0.900000
:
:: But when compiled with one particular popular free C compiler, this
:: program will print 0.800000.  
:
:Free ?  I think that the people at Watcom will beg to differ with you.  (-:

gcc 2.6.3 on IRIX 5.2 gets it wrong, unfortunately.  It's still my
favorite free compiler tho :)

-- 
---
Tim Hollebeek                   'There will be a better sig when I have time'



