#: 20073 S3/Languages
26-Jun-94 10:25:22
Sb: #20067-#Coco/OSK C compilers
Fm: Pete Lyall 76703,4230
To: David Breeding 72330,2051 (X)
This isn't a bug, nor is it abnormal for compilers written for machines with
larger wordsizes. The reason is that the CPU needs to make an address reference
to a certain address boundary, usually on a multiple of the wordsize. Internal
to the structure, they call this 'padding'.
If you need to write the structure to disk in a semi-portable fashion, you'll
have to write out each element individually:
write(fd,struct->element1,sizeof(struct->element1);
write(fd,struct->element2,sizeof(struct->element2);
etc.......
Pete Lyall
There is 1 Reply.
|