Author: Robert Hyatt
Date: 05:53:39 06/27/00
Go up one level in this thread
On June 27, 2000 at 05:15:27, Gian-Carlo Pascutto wrote: >On June 26, 2000 at 21:25:05, Robert Hyatt wrote: > >>That ought to work ok, > >GCC barfs on it. :( > >>but it has some severe portability problems. The >>ANSI standard doesn't specify from which "end" of the word the bit fields >>start. Nor does it specify whether the default is "signed" or "unsigned". > >I dont get this. The bitfield type is specified as an unsigned int. So >the bitfields must all be unsigned int's too, right ? Nope. For an interesting debugging problem, run the above on a Sun SPARC and then on an IBM RS6000. You will be amazed. :) > >Now, if we set an unsigned int to 0, isn't it safe to assume the idividual >fields will also be 0? Yes. > >In other words, are there any machines were an unsigned int that equals >zero != binary 000000..0? > >-- >GCP No. But the order of the bits within the 'int' can be arbitrary. Which means that if you use this in an opening book (for example) you will have serious compatibility/portability problems on different machine.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.