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: C Programming Tutorial on Youtube Date: Tue, 11 Oct 2016 12:18:37 -0700 Organization: None to speak of Lines: 32 Message-ID: References: <8be0cdbe-c2f4-42ec-b6a7-e9a154981718@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="c91660510313b0b3b2b18aebbb52bfad"; logging-data="20580"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lj4r7PgfN7X2m5GrpLVj4" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:8MKUDIy0A5jQN9CTxEehxsoIozg= sha1:T1GEf2pZIb0iR790n0QBg/e1ZTI= Xref: csiph.com comp.lang.c:94741 ram@zedat.fu-berlin.de (Stefan Ram) writes: > supercat@casperkitty.com writes: >>Whether *any* pointer represents any kind of address is an implementation > > The null pointer might be called an "address constant". > > »An address constant is a null pointer, a pointer to an > lvalue designating an object of static storage duration, > or a pointer to a function designator«, 6.6.p9 > > This says that an address constant can be a null pointer. > > Read from the right to the left, it says that a null > pointer is an address constant. > > I think it's safe to say that an address constant is an address. > So a null pointer is an address. > It is just not an address /of an object/. That section is badly worded in my opinion. An "address constant" is a source code construct. A "null pointer" is a runtime value. It's clear enough that at least `(void*)0` is an "address constant". I suppose it's therefore reasonable to infer that a null pointer value is an "address". I'd be more comfortable with that conclusion if it were stated more clearly. -- 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"