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: Wed, 26 Oct 2016 09:05:51 -0700 Organization: None to speak of Lines: 47 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="25904"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DhfLAZO1t1Q2KFfWZTe/q" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:M/+VjGXF7/smlBPAjp7hF1EnVB0= sha1:bjdbaM/lQGETNEtzYjaBTBFh3vo= Xref: csiph.com comp.lang.c:95327 BartC writes: > On 26/10/2016 07:27, Ike Naar wrote: >> On 2016-10-25, BartC wrote: >>> You don't need to explain why &*p is allowed >>> but not & &**p or *&p! >> >> What makes you believe that *&p is not allowed? > > OK that one is allowed: > > *&*&*&*p; > > as is: > > &*&*&*p; > > when p is a pointer. But not: > > ***& & &p; > > or: > > & & &***p; // allowed on some compilers when p is T*** Any compilers that do not diagnose that are non-conforming. And the simple reason for that has been explained several times. No doubt the inability to write & & &***p has been a great inconvenience to you. > If, however, you go through this on paper, striking through * followed > by &, or & followed by * with a pencil, and repeating, you end up with > just 'p' in all cases. And p doesn't need to be a pointer. > > On paper. If I invent an arbitrary rule that doesn't actually exist in the language, and then execute that rule using pencil and paper, I can reach any nonsensical conclusion I like. The & and * operators do not arbitrarily cancel each other out, and your obsession with the idea that they do or should is absurd. -- 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"