diff options
author | Richard Stallman <rms@gnu.org> | 1993-05-06 16:02:40 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-05-06 16:02:40 +0000 |
commit | 619fdc9c7a57494aed214046d1a06e59a614ce4a (patch) | |
tree | 493c6853187af9ca4e4c7f73daa4a7c5ce6185d3 /gcc | |
parent | 266dd51787cc66eb06c1aeb7598eda623fd6ed57 (diff) | |
download | gcc-619fdc9c7a57494aed214046d1a06e59a614ce4a.zip gcc-619fdc9c7a57494aed214046d1a06e59a614ce4a.tar.gz gcc-619fdc9c7a57494aed214046d1a06e59a614ce4a.tar.bz2 |
(convert_for_assignment): Don't use convert_and_check
when handling arithmetic types here.
From-SVN: r4358
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 9a4cdec1..088e877 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4148,7 +4148,11 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) && (coder == INTEGER_TYPE || coder == REAL_TYPE || coder == ENUMERAL_TYPE || codel == COMPLEX_TYPE)) - return convert_and_check (type, rhs); + /* Don't use convert_and_check here. If the input has type int + and did not overflow, and we are converting it here to a short, + we don't want an error. A warning would be okay, but it's too risky now + to add an option to convert_and_check to get just warnings. */ + return convert (type, rhs); /* Conversion to a union from its member types. */ else if (codel == UNION_TYPE) { |