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: Sat, 05 Nov 2016 18:41:54 -0700 Organization: None to speak of Lines: 24 Message-ID: References: <87bmxxm6zs.fsf@gmail.com> <871syrijhw.fsf@bsb.me.uk> <8737j7gd87.fsf@bsb.me.uk> <87twbmfzah.fsf@bsb.me.uk> <87fun6f1j4.fsf@bsb.me.uk> <877f8hgb0p.fsf@bsb.me.uk> <87eg2pedkx.fsf@bsb.me.uk> <8e5b1622-0525-4c9b-97dc-0aeba0bc1f94@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="d0d2eb2bf0baae43eeb9ce130bb24749"; logging-data="30691"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lO/jhjGnadVJkCMRgXwN/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:jgCUCPWMbBWU6mwpT3ZsmrxVzpk= sha1:uIDFUFDAKyw8oFjOuZ6vqQ/4ukM= Xref: csiph.com comp.lang.c:95896 supercat@casperkitty.com writes: > On Saturday, November 5, 2016 at 6:01:25 PM UTC-5, Ben Bacarisse wrote: >> We are talking about C and, in C, [] is a pointer operation. I fully >> accept that you don't like thinking of it that way but I ask you to >> consider that refusing to do so may be causing you some trouble. > > Given the construct: > > union BLOB64{ uint8_t as8[8]; > uint16_t as16[4]; > uint32_t as32[2]; > uint64_t as64[1]; } blob; > > would a compiler be required to recognize aliasing between blob.as32[0] > and blob.as16[0]? [...] Nobody was talking about aliasing. -- 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"