Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Invalid values for integers

Thread Tools

Invalid values for integers

David Thompson
Posts: n/a
On Wed, 20 Feb 2008 13:01:58 GMT, Removed) (Richard
Bos) wrote:
<snip other points>
> It can cause UB. Note that a recent TC has (IIRC) outlawed padding bits
> within normal unsigned ints, and someone will now undoubtedly remind me
> whether it also does so for signed ones.

YDNRC; you may have conflated some related things.

TC2 changed to require that all-zero-bits is a valid
representation of value zero in all integer types (signed and
unsigned, and plain char which formally is neither). Thus IF there are
padding bits in an integer type, it must be valid to have padding = 0
when magnitude+sign_if_any = 0.

TC2 also changed about the conditions which require the
implemention to define [u]int{8,16,32,64}_t so they match (in fact
repeat) the requirements for those typedefs in p1 and p2.

C99 required that unsigned char have no padding bits, with
no such requirement on any other type, and this hasn't changed. Though
IF the implementation chooses to make plain char like unsigned char,
that must use the same representation and thus have no padding bits.

- formerly david.thompson1 || achar(64) ||
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get select values to add as integers instead of strings. Mechphisto Javascript 4 06-12-2010 01:36 AM
How to convert he boolean values into integers krishna Python 2 06-25-2009 12:33 PM
Invalid URI: There is an invalid sequence in the string. Error!! Patrick.O.Ige ASP .Net 1 07-02-2006 11:21 AM
Numarray - Using Integers Efficiently for Boolean Values Python 0 02-16-2006 06:19 PM
Problems with conversion of values in strings to integers =?ISO-8859-1?Q?J=F8rgen_Cederberg?= Python 8 10-09-2003 11:05 AM