🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Bjoern Wennberg Mon, 14 Dec 1992 14:13
Bug in gcc-2.3.2 and double (ISC)
#1537
Author: Bjoern Wennberg
Date: Mon, 14 Dec 1992 14:13
44 lines
1312 bytes
OS: Interactive-3.0 SYSVR3.2
COMPILER: gcc-2.3.2
DESCRIPTION OF BUG: gcc-2.3.2 doesn't handle doubles right:

Here is a small example which illustrates the problem:
input file: c.c

#include <stdio.h>
#include <float.h>
#include <math.h>

void main() { 
  double d = DBL_MAX;
  printf("%G\n", d);
}

gcc gives wrong output:
# gcc-v
Reading specs from /usr/local/lib/gcc-lib/i486-isc/2.3.2/specs
gcc version 2.3.2

# gcc c.c
# a.out
INF

Using the native c-compiler gives the correct output:
# cc c.c
# a.out
1.79769E+308


Strange is that compiling with gcc-2.2.2 gives this:
#/global/gnu/bin/gcc -v
Reading specs from /global/gnu/lib/gcc-lib/isc/2.2.2/specs
gcc version 2.2.2
#/global/gnu/bin/gcc c.c
#a.out
1.79769E+308

Can someone please fix this ?

bjornw>
--
bjornw@edb.tih.no     Bjoern Wennberg     Trondheim College of Engeneering
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads