Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Invalid values for integers

 
 
David Thompson
Guest
Posts: n/a
 
      03-02-2008
On Wed, 20 Feb 2008 13:01:58 GMT, http://www.velocityreviews.com/forums/(E-Mail 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 6.2.6.2 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 7.18.1.1p3 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 6.2.6.2p1 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) || worldnet.att.net
 
Reply With Quote
 
 
 
Reply

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 andrewfelch@gmail.com 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



Advertisments