** help...

Henry Spencer henry at zoo.toronto.edu
Sat Sep 1 02:26:45 AEST 1990


In article <1912 at islay.tcom.stc.co.uk> rmj at htc1.UUCP (Rhodri James) writes:
>The crux of the potential health hazard comes with the definition of
>sizeof, which K&R2 says (section 6.3) gives a size_t result equal to the
>size of the specified object or type in bytes. Nothing here guarentees
>that the *end* of the object will be such that another object straight
>after it in memory (which is what the multiplication implies) will be
>correctly aligned...

Please take a long hard look at section A7.4.8 of K&R2.  The numbered
chapters, useful though they are, are *not* meant as a precise definition
of the language; they are a tutorial.  Appendix A is the reference manual.

Actually, if you want a definitive reference you have to look at the ANSI
C standard itself, but in fact K&R2 A7.4.8 clears this issue up quite
satisfactorily.
-- 
TCP/IP: handling tomorrow's loads today| Henry Spencer at U of Toronto Zoology
OSI: handling yesterday's loads someday|  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list