aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-11-21 11:06:09 -0800
committerJim Wilson <wilson@gcc.gnu.org>1994-11-21 11:06:09 -0800
commite0bf6b33d8c20f0ecfa9e9e5040538170893a172 (patch)
tree14044b9c10df067297eda8e957f1ce5278e1159b
parent9d99bd1b8d93f94e81bf5f259577f53bf2c268c3 (diff)
downloadgcc-e0bf6b33d8c20f0ecfa9e9e5040538170893a172.zip
gcc-e0bf6b33d8c20f0ecfa9e9e5040538170893a172.tar.gz
gcc-e0bf6b33d8c20f0ecfa9e9e5040538170893a172.tar.bz2
(yylex): Do warn about floating point out of range if target floating-point format is IEEE.
(yylex): Do warn about floating point out of range if target floating-point format is IEEE. Use warning instead of pedwarn to avoid getting errors. From-SVN: r8538
-rw-r--r--gcc/c-lex.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 17d50be..e4d8bf9 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1360,24 +1360,24 @@ yylex ()
type = float_type_node;
value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
- if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- && REAL_VALUE_ISINF (value) && pedantic)
- pedwarn ("floating point number exceeds range of `float'");
+ /* A diagnostic is required here by some ANSI C testsuites.
+ This is not pedwarn, become some people don't want
+ an error for this. */
+ if (REAL_VALUE_ISINF (value) && pedantic)
+ warning ("floating point number exceeds range of `float'");
}
else if (lflag)
{
type = long_double_type_node;
value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
- if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- && REAL_VALUE_ISINF (value) && pedantic)
- pedwarn ("floating point number exceeds range of `long double'");
+ if (REAL_VALUE_ISINF (value) && pedantic)
+ warning ("floating point number exceeds range of `long double'");
}
else
{
value = REAL_VALUE_ATOF (copy, TYPE_MODE (type));
- if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- && REAL_VALUE_ISINF (value) && pedantic)
- pedwarn ("floating point number exceeds range of `double'");
+ if (REAL_VALUE_ISINF (value) && pedantic)
+ warning ("floating point number exceeds range of `double'");
}
set_float_handler (NULL_PTR);
@@ -1387,11 +1387,10 @@ yylex ()
{
/* ERANGE is also reported for underflow,
so test the value to distinguish overflow from that. */
- if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- && (REAL_VALUES_LESS (dconst1, value)
- || REAL_VALUES_LESS (value, dconstm1)))
+ if (REAL_VALUES_LESS (dconst1, value)
+ || REAL_VALUES_LESS (value, dconstm1))
{
- pedwarn ("floating point number exceeds range of `double'");
+ warning ("floating point number exceeds range of `double'");
exceeds_double = 1;
}
}