This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/35634] [avr] result of char promotion comes out of CHAR_MIN/MAX
- From: "schwab at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2008 09:56:44 -0000
- Subject: [Bug target/35634] [avr] result of char promotion comes out of CHAR_MIN/MAX
- References: <bug-35634-6291@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from schwab at suse dot de 2008-03-19 09:56 -------
Actually, there is no undefined behaviour here, as long as CHAR_MAX < INT_MAX
no overflow occurs. c++ is the same as c = (int)c + 1 (when ignoring the
result), and the conversion from int to char is implementation defined. For
gcc the result of such a conversion is always in the range of the target type.
--
schwab at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35634