Author: Robert Hyatt
Date: 16:26:43 01/11/03
Go up one level in this thread
On January 11, 2003 at 16:44:26, Miguel A. Ballicora wrote: >On January 11, 2003 at 11:40:00, Robert Hyatt wrote: > >>What do you suppose will happen when we have 64 bit machines with 128 bit >>integers? Care to guess what that will do to portability when you try to >>send binary files around between a 32 bit and a 64 bit architecture? Then >>you might begin to see _the_ problem with the data types as they exist. > >To send binary files portably you have to do it byte by byte, so it is the same >no matter what system you use. You cannot send an int32 as a block, that is not >portable at all no matter what system you use. Sure it is. It is only non-portable on machines with different endianess. But even with that, if I write an "int" how many bytes do I write? > >>>Even if you want something very specific you can use unsigned bitfields so they >>>will wrap after 12, 17 or whatever bits you want. Generally using the 'and' is >>>so simple that it doesn't justify to be bothered. >> >> >>Sorry but that is wrong. Bitfields are not well-defined in the standard. >>Which end do they start from? You instantly see the problem with using them. >>And trying to put them into a structure adds a random amount of padding, >>the random amount being the unused bits in a native "thing" the compiler has >>to use, which is yet another problem. > >It does not matter if you use one bitfield per structure just to use a number >with "x bits" if you really want that number defined in that way. > >Miguel Doesn't matter which end of a word a bit field starts on? Doesn't matter which order the bitfield variables appear in? To an operating systems person it matters a _bunch_ because the definitions for O/S tables are pre-defined and I just want to access them. And I can't...
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.