🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2737

gcc-1.35 fix eliminates SunOS' spurious warnings about "floating point number exceeds range of `double'"

#2737
From: Jim Meyering
Date: Wed, 07 Jun 1989 03:08
43 lines
1824 bytes
For quite some time, the sun4-os4 version of gcc has been
giving misleading warnings about floating constants like "0.0e0,"
complaining that they exceed the range of 'double.'

Here's a simple patch to gcc-1.35:
--
Jim Meyering      meyering@cs.utexas.edu

*** c-parse.tab.c-orig	Tue Jun  6 17:21:39 1989
--- c-parse.tab.c-new	Tue Jun  6 21:53:23 1989
***************
*** 3420,3430 ****
  	    if (errno == ERANGE && !flag_traditional)
  	      {
  		char *p1 = token_buffer;
! 		/* Check for "0.0" and variants;
  		   Sunos 4 spuriously returns ERANGE for them.  */
  		while (*p1 == '0') p1++;
! 		if (*p1 == '.') p1++;
! 		while (*p1 == '0') p1++;
  		if (*p1 != 0)
  		  warning ("floating point number exceeds range of `double'");
  	      }
--- 3420,3437 ----
  	    if (errno == ERANGE && !flag_traditional)
  	      {
  		char *p1 = token_buffer;
! 		/* Check for "0.0" and variants like "0.00" and "0.0e0";
  		   Sunos 4 spuriously returns ERANGE for them.  */
  		while (*p1 == '0') p1++;
! 		if (*p1 == '.') {
! 		  p1++;
! 		  while (*p1 == '0') p1++;
! 		}
! 		if (*p1 == 'e' || *p1 == 'E') {
! 			/* with significand==0, ignore the exponent */
! 		  p1++;
! 		  while (*p1 != 0) p1++;
! 		}
  		if (*p1 != 0)
  		  warning ("floating point number exceeds range of `double'");
  	      }
Technical Details
Message-ID: <8906070308.AA00653@ai.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!CS.UTEXAS.EDU!meyering

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!CS.UTEXAS.EDU!meyering
From: meyering@CS.UTEXAS.EDU (Jim Meyering)
Newsgroups: gnu.gcc.bug
Subject: gcc-1.35 fix eliminates SunOS' spurious warnings about "floating point number exceeds range of `double'"
Message-ID: <8906070308.AA00653@ai.cs.utexas.edu>
Date: 7 Jun 89 03:08:52 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: UofTX @ Austin CS Department
Lines: 43