meyering@CS.UTEXAS.EDU (Jim Meyering) (06/07/89)
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'");
}