Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: pointers Date: Mon, 24 Oct 2016 12:22:43 -0700 Organization: None to speak of Lines: 30 Message-ID: References: <18d7b7b9-ea72-49d3-9535-df13d560473c@googlegroups.com> <726d78eb-47b3-1b92-0203-e2f63bb740ae@verizon.net> <2cbb3b2a-06b9-4edb-b8a0-956fdd120eb4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="dc97ebc10d9ee65592f107439c98c97d"; logging-data="18800"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9qpF11W8HWC957VcI7ORr" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Ty63kXC7EaBdLLyF61IJjAy9OGk= sha1:xPPJtPmKG+bfHfQAXgOuq7BgmFQ= Xref: csiph.com comp.lang.c:95240 supercat@casperkitty.com writes: > On Monday, October 24, 2016 at 11:52:05 AM UTC-5, Keith Thompson wrote: >> So the only reason you can think of to use those constructs is to >> illustrate them? That's hardly a good reason to add them to the >> language. > > Especially on implementations where all pointers have the same representation > and are alias-compatible with void*, it would be helpful to have a means by > which a macro that wraps a function call could ensure that it is given a > double-indirect pointer to some kind of object. If the final target type > were required to be something other than "void", such a macro could perhaps > use: > > foo(sizeof(**(theHandle)) >= 0 ? (void**)(theHandle) : 0)); > > Since sizeof would not evaluate its operand, that would only cause theHandle > to be evaluated once. I can't think of any other way, though, to write a > macro which would cast its argument to void** in the event that it was any > kind of double-indirect pointer, but would squawk if it were anything else. How is that relevant? BartC is talking about constructs that are not valid in C. (Of course void** is not a generic pointer-to-pointer type.) -- 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"