aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-08 07:13:12 +0000
committerRichard Stallman <rms@gnu.org>1992-10-08 07:13:12 +0000
commit547ad557720b58ae1d100072261de35e63dd157e (patch)
tree5033c381554dc21a3ae282e8780b98882ffb950a /gcc
parent09a99207eaaf6b783272df3b2e9d55390b065215 (diff)
downloadgcc-547ad557720b58ae1d100072261de35e63dd157e.zip
gcc-547ad557720b58ae1d100072261de35e63dd157e.tar.gz
gcc-547ad557720b58ae1d100072261de35e63dd157e.tar.bz2
(yylex): For floats, Use REAL_VALUES_LESS to distinguish underflow from overflow.
(yylex): For floats, Use REAL_VALUES_LESS to distinguish underflow from overflow. Delete special case for 0.0. From-SVN: r2363
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-lex.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index bfbc920..924a22c 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1370,24 +1370,10 @@ yylex ()
#ifdef ERANGE
if (errno == ERANGE && !flag_traditional && pedantic)
{
- 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 == 'e' || *p1 == 'E')
- {
- /* with significand==0, ignore the exponent */
- p1++;
- while (*p1 != 0) p1++;
- }
- /* ERANGE is also reported for underflow,
- so test the value to distinguish overflow from that. */
- if (*p1 != 0 && (value > 1.0 || value < -1.0))
+ /* ERANGE is also reported for underflow,
+ so test the value to distinguish overflow from that. */
+ if (REAL_VALUES_LESS (dconst1, value)
+ || REAL_VALUES_LESS (value, dconstm1))
{
pedwarn ("floating point number exceeds range of `double'");
exceeds_double = 1;