Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: usecases of void foo(char **b) {} Date: Tue, 08 Nov 2016 08:06:40 -0800 Organization: None to speak of Lines: 21 Message-ID: References: <877f8hgb0p.fsf@bsb.me.uk> <87eg2pedkx.fsf@bsb.me.uk> <87wpghcu23.fsf@bsb.me.uk> <877f8gx44n.fsf@bsb.me.uk> <878tswb89s.fsf@bsb.me.uk> <87wpgg9l8k.fsf@bsb.me.uk> <87a8dba7ab.fsf@bsb.me.uk> <1a898248-9e83-4ec5-960a-23fa13461a06@googlegroups.com> <305bbfee-a379-4eef-a581-175f983bb589@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="e43f89eff67778d2e2548cd041b513fe"; logging-data="15168"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DpolAjHH4u5ojQMrDRFpM" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:oZ/Rk6z+V8SWC7RTuGk2J+2+Ny8= sha1:mstCsIDXMw3v+iUuFkaOm64VFCg= Xref: csiph.com comp.lang.c:96093 supercat@casperkitty.com writes: [...] > The Standard would allow for arrays with an even number of elements to > be placed in structures using an alignment coarser than the element type, > and on some hardware platforms (especially those which do not have octet- > addressable memory but emulate an octet "char" type) there may be benefits > to doing so. The standard allows for any struct member other than the first to be placed at any alignment the compiler chooses, as long as it satisfies the alignment requirements of the member's type. In struct { char c0; char c1; }; the compiler could legally place c1 at offset 137. [snip] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"