[FFmpeg-devel] [RFC] Sechole in gcc 3.3+ and 4.*

Uoti Urpala uoti.urpala
Mon Apr 7 16:41:46 CEST 2008


On Mon, 2008-04-07 at 16:30 +0200, Michael Niedermayer wrote:
> On Mon, Apr 07, 2008 at 04:58:30PM +0300, Uoti Urpala wrote:
> > On Mon, 2008-04-07 at 15:42 +0200, Michael Niedermayer wrote:
> > > Above defines strictly how signed integers are represented on twos complement
> > > systems. As a side effect this requires the +-* operations to be identical to
> > > unsigned integers.
> > 
> > It does not. There is (rather obviously IMO) no requirement that if A
> > and B have different types but the same representation, and similarly C
> > and D, then A+C would need to have the same representation as B+D.
> 
> Each value within the supported range has a clear repesentation and each
> representation has a clear value. The value of A+C and B+D are defined
> by the arithmetic in Z/nZ n=2^m 

The C standard does NOT define the value of A+C by arithmetic in Z/nZ.
It is defined by arithmetic in Z. For unsigned types *only* it is
defined (in 6.2.5 Types, paragraph 9) that results which can not be
represented in the type are reduced modulo MAX+1.





More information about the ffmpeg-devel mailing list