Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: ** help...
Message-ID: <1990Aug31.162645.10584@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <2409@dsacg2.dsac.dla.mil> <1884@jura.tcom.stc.co.uk> <11245@crdgw1.crd.ge.com> <1912@islay.tcom.stc.co.uk> <1990Aug30.191533.20589@laguna.ccsf.caltech.edu>
Date: Fri, 31 Aug 90 16:26:45 GMT

In article <1912@islay.tcom.stc.co.uk> rmj@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@zoo.toronto.edu   utzoo!henry
