C++ Logo

sg12

Advanced search

Re: [ub] [c++std-ext-14592] Re: Re: Sized integer types and char bits

From: John Regehr <regehr_at_[hidden]>
Date: Sun, 27 Oct 2013 10:08:26 -0600
>> Wow-- anyone care to guess what fraction of existing C programs run
>> correctly under these conditions?
> Define correctly.

A conforming program could be said to run correctly under a
non-conforming C implementation if some test suite fails to find
anything wrong with the program.

For example it's not uncommon to see programs that use
1<<(sizeof(int)*CHAR_BIT-1) instead of INT_MIN. Any such program would
be highly unlikely to run correctly on the 36-bit ones complement C
implementation.

John

Received on 2013-10-27 17:08:44