On Tue, 29 Nov 2011, Nadezhda Ivan?vna Vyukova wrote:

> I've explained the customer that by default char is treated
> as signed char on our platform and therefore this program 
> does not conform ISO C90, as it causes the integer overflow
> (undefined behavior). But he was not satisfied.

Actually this program does not involve undefined behavior, because the 
increment happens in type int and then implementation-defined behavior 
converting the int to char (which GCC defines as modulo) applies.  See PR 
35634 which has various discussion of possible approaches for fixing 
this, and patches that introduce vectorizer optimization regressions.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to