tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

style: structures



In the style file, for structures, the emphasis is put on alignment in
order to not waste memory because of undue padding.

Shouldn't an exception been mentionned concerning structures that may be
derived from a base structure, so that the first member of the derived
structures is a base structure, using the C standard guaranteed property
that the address of the first member is the address of the structure,
allowing to cast pointers in order to operate whether on the base
structure or on the derived structure?
-- 
        Thierry Laronde <tlaronde +AT+ kergis +dot+ com>
                     http://www.kergis.com/
                    http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index