Mail Archives: djgpp/1996/12/03/23:47:53
Leath Muller (leathm AT gbrmpa DOT gov DOT au) wrote:
: Benjamin D Chambers wrote:
: >
: > I just wanted to check:
: > What are the bit-sizes of data types in DJGPP?
: > As in, which is 8-bit, 16-bit, and 32-bit types?
: > I thought int was 16-bit, but now I'm not so sure...
:
: char = 8 bits
: short int = 16 bit (I think, I use asm a lot... :)
: int = 32 bit
: (void *), (char *) etc = 32 bit
:
: Leathal.
The above is correct but if you are using structures, fields are often
aligned to 4 byte boundaries. For example, two adjacent shorts may have
two bytes of padding in between them. If this is the case, see info gcc,
look under C extensions, read the alignment, variables attributes, and
type attributes (I'm using DJGPP 2.01, but I expect it to be the same
under other verions).
Jeff
- Raw text -