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: pointers Date: Tue, 25 Oct 2016 16:44:39 -0700 Organization: None to speak of Lines: 50 Message-ID: References: <18d7b7b9-ea72-49d3-9535-df13d560473c@googlegroups.com> <726d78eb-47b3-1b92-0203-e2f63bb740ae@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="2e7171af2bda6d09a7fcdc04643cbc45"; logging-data="10775"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bYT8pHxkx1wRFgI8bOJXC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:dZAALdaWDcXQJkoPJ8BbwVUhUvg= sha1:XXyfSR/rJq2nC3hOgvAOuuPxc/c= Xref: csiph.com comp.lang.c:95318 BartC writes: > On 25/10/2016 23:39, Keith Thompson wrote: >> BartC writes: > >>> The advantage is obvious. You don't need to explain why &*p is allowed >>> but not & &**p or *&p! >> >> You're the only person I've had to explain that to. And I'm still not >> sure whether you don't understand the explanation or just don't like it. > > It's simple: you think of & as something that needs to be applied to > some 'lvalue' according to a lawyerly account in a language > reference. The /C/ language reference. You're distorting what I said. The C standard is the definitive reference for the C language, but the rules it gives for the unary "&" operator also *make sense* to me. > I don't think like that at all. I just use & either to get the address > of a storage location designated by an expression, or to offset a > pointer operation. I don't care what the standard says! I suggest that's why you have such difficulty understanding or accepting the actual rules. You think `& &*foo` makes some kind of sense, and you refuse to accept the reasonably straightforward reasons that it doesn't. > I'm not that bothered what language it is either. When you're dealing > with explicit pointers then the issues of applying address-of or > dereferencing pointers are universal. Not really. Applying address-of makes sense only when there's an object whose address you want. > Apparently C is fussy about how & and * are combined. That's fine. My > own language isn't, and the generated C code has ref/deref chains > normalised' so as to be suitable for C's sensitivities. (I've had a > lot of practice!) > > So no problem. Do me a favor. Next time I try to explain something to you, please tell me right away that you don't care about it. Don't waste time telling me that you don't accept what I'm saying, just tell me you don't care, and I'll stop. In fact I think I'll just assume that from the start. -- 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"