diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-04-25 10:22:15 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-04-25 10:22:15 -0400 |
commit | 6c548216354907c4997330ba34d488d5d181205f (patch) | |
tree | c3e065d9c3413d0eeb8634dbc2e1eb776c0d4a82 | |
parent | 9b553fdbd7a57e6d92dfb33abb87e49b584af412 (diff) | |
download | gcc-6c548216354907c4997330ba34d488d5d181205f.zip gcc-6c548216354907c4997330ba34d488d5d181205f.tar.gz gcc-6c548216354907c4997330ba34d488d5d181205f.tar.bz2 |
(yylex): Don't warn about floating point out of range if target
floating-point format is IEEE.
From-SVN: r4213
-rw-r--r-- | gcc/c-lex.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index f4ab73c..ea6c015 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1486,7 +1486,8 @@ yylex () case 'f': case 'F': type = float_type_node; value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type)); - if (REAL_VALUE_ISINF (value) && pedantic) + if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT + && REAL_VALUE_ISINF (value) && pedantic) pedwarn ("floating point number exceeds range of `float'"); garbage_chars = -1; break; @@ -1494,7 +1495,8 @@ yylex () case 'l': case 'L': type = long_double_type_node; value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type)); - if (REAL_VALUE_ISINF (value) && pedantic) + if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT + && REAL_VALUE_ISINF (value) && pedantic) pedwarn ( "floating point number exceeds range of `long double'"); garbage_chars = -1; @@ -1509,7 +1511,8 @@ yylex () default: value = REAL_VALUE_ATOF (token_buffer, TYPE_MODE (type)); - if (REAL_VALUE_ISINF (value) && pedantic) + if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT + && REAL_VALUE_ISINF (value) && pedantic) pedwarn ("floating point number exceeds range of `double'"); } set_float_handler (NULL_PTR); @@ -1519,8 +1522,9 @@ yylex () { /* 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)) + if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT + && (REAL_VALUES_LESS (dconst1, value) + || REAL_VALUES_LESS (value, dconstm1))) { pedwarn ("floating point number exceeds range of `double'"); exceeds_double = 1; |