CompuServe Messages

#C structure size

    04-Jun-90 02:07:34
Sb: #107556-#C structure size
Fm: John Draper 76703,4322
To: Jerry Masker 76657,1775
Jerry, One of the earliest problems I had with C was due to padding that did not explicitly show up in the structure definition. I was accessing the struct with an assembler routine, and the pad byte (in the MIDDLE of a struct) nailed me real good. Of course it really was my fault for not looking at the assembler version of the struct. I guess padding, if it must be applied, should probably be done for all things, including 'all byte' structs, mainly because of the speed penalty, not only in having to copy on a byte basis, but also to keep the natural alignment for speed on the 68020 and 68030. -larry