Subj : Re: overflow in C To : comp.programming From : DarkD Date : Wed Sep 21 2005 11:07 pm C99 says its 'undefined behavoiur' if its signed. This is because a computer could be using one's compliment or two's compliement, or even ignores the most significant bit. A compiler is allowed to error on this (and should), alot ignore it. For unsigned a modulo is performed with the max number of values, so a char set to 257 will be 1. > signed char a = 130; > > I explicitly generate an overflow since the maximum value a singned char > can accommodate is "127". Is this behavior of the overflow defined in any > way or do I get an undefined state of "a" due to the C standards? .