diff options
author | Jeff Law <law@gcc.gnu.org> | 1998-04-04 06:32:39 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-04-04 06:32:39 -0700 |
commit | e5e809f4194e578b5fbd48fc5a1df2377f28d197 (patch) | |
tree | 6743f11e58bd7a933b08900d973d89026cd11c43 /gcc/c-lex.c | |
parent | 31031eddacda46a500b2390f52cd4474bcaf84ca (diff) | |
download | gcc-e5e809f4194e578b5fbd48fc5a1df2377f28d197.zip gcc-e5e809f4194e578b5fbd48fc5a1df2377f28d197.tar.gz gcc-e5e809f4194e578b5fbd48fc5a1df2377f28d197.tar.bz2 |
* Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details.
* haifa-sched.c: Mirror recent changes from gcc2.
From-SVN: r18984
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index a9863aa..99b21c0 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1,5 +1,5 @@ /* Lexical analyzer for C and Objective C. - Copyright (C) 1987, 88, 89, 92, 94-96, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 89, 92, 94-97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -1513,8 +1513,8 @@ yylex () if (floatflag != NOT_FLOAT) { tree type = double_type_node; - int exceeds_double = 0; int imag = 0; + int conversion_errno = 0; REAL_VALUE_TYPE value; jmp_buf handler; @@ -1543,7 +1543,6 @@ yylex () } *p = 0; - errno = 0; /* Convert string to a double, checking for overflow. */ if (setjmp (handler)) @@ -1613,7 +1612,9 @@ yylex () error ("both `f' and `l' in floating constant"); type = float_type_node; + errno = 0; value = REAL_VALUE_ATOF (copy, TYPE_MODE (type)); + conversion_errno = errno; /* A diagnostic is required here by some ANSI C testsuites. This is not pedwarn, become some people don't want an error for this. */ @@ -1623,13 +1624,17 @@ yylex () else if (lflag) { type = long_double_type_node; + errno = 0; value = REAL_VALUE_ATOF (copy, TYPE_MODE (type)); + conversion_errno = errno; if (REAL_VALUE_ISINF (value) && pedantic) warning ("floating point number exceeds range of `long double'"); } else { + errno = 0; value = REAL_VALUE_ATOF (copy, TYPE_MODE (type)); + conversion_errno = errno; if (REAL_VALUE_ISINF (value) && pedantic) warning ("floating point number exceeds range of `double'"); } @@ -1637,17 +1642,12 @@ yylex () set_float_handler (NULL_PTR); } #ifdef ERANGE - if (errno == ERANGE && !flag_traditional && pedantic) - { - /* 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)) - { - warning ("floating point number exceeds range of `double'"); - exceeds_double = 1; - } - } + /* ERANGE is also reported for underflow, + so test the value to distinguish overflow from that. */ + if (conversion_errno == ERANGE && !flag_traditional && pedantic + && (REAL_VALUES_LESS (dconst1, value) + || REAL_VALUES_LESS (value, dconstm1))) + warning ("floating point number exceeds range of `double'"); #endif /* If the result is not a number, assume it must have been |