Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.std.c Subject: Re: Footnote in section on Address-Of Operator Date: Wed, 23 Nov 2022 18:48:40 -0800 Organization: A noiseless patient Spider Lines: 25 Message-ID: <86o7sx83uf.fsf@linuxsc.com> References: <3aa216b0-365a-42b0-aceb-959cf5a1a747n@googlegroups.com> <87pmddi5e7.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader01.eternal-september.org; posting-host="8ee213438f0e6ab517cae470e775d09b"; logging-data="532317"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eAmnCPCYm+ygO2u40XcM7STrbqS6Cswg=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:mAQvcPchfd+ylfuD25JvTJ+5zU4= sha1:rc0sUE5zvg/MHesLw3R+5NmRcfk= Xref: csiph.com comp.std.c:6457 Ben Bacarisse writes: > JoJoModding writes: > >> in the paragraph on address and indirection operators (6.5.3.2 in the >> C23 draft N3047), there is a footnote (footnote 117 in that draft), >> which says that >> >>> &*E is equivalent to E (even if E is a null pointer) > > This seems to be a case where a footnote might add confusion rather than > clarity. The normative text makes it clear that &*E can't be equivalent > to E in every way because &*E is not an lvalue. And &*E has type > constraints that E does not have. > >> This seems to imply that sizeof(&*E) == sizeof(E), which is unexpected >> if E is an array. > > There are much simpler examples if the apparent non-equivalence. If p > is a pointer object, p can be assigned to by &*p can't be. And due to > the clause about constraints. &*(void *)0 is a constraint violation, > but (void *)0 is obviously fine. What makes you say &*(void*)0 is a constraint violation? I don't see any constraints that are violated.