On Wed, Mar 2, 2011 at 2:49 AM, Eli Friedman <eli.fried...@gmail.com> wrote:
> PR9350: increment/decrement of char (and anything else narrower than int)
> can't overflow due to promotion rules; emit a wrapping add for those cases.

The addition may not be able to overflow, but if the result is not
representable in the (signed) character type it's converted to then
"either the result is implementation-defined or an
implementation-defined signal is raised" [C99 6.3.1.3p3].
However, I'm not fluent enough in standardese to know whether that
allows a non-wrapping add to be used in this case. Is 'undef' a valid
implementation-defined result?
(Also, I didn't check C89 or any C++ standards)
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to