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: C Programming Tutorial on Youtube Date: Tue, 11 Oct 2016 14:40:59 -0700 Organization: None to speak of Lines: 46 Message-ID: References: <8be0cdbe-c2f4-42ec-b6a7-e9a154981718@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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="U2FsdGVkX1/6Q8ms0CrFzSAxuspqiS02" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:RjPIywveU6VNEIiQmjEH//8ab0Y= sha1:fOcVQ5AQ1HaxdQWBc2G67qbivzc= Xref: csiph.com comp.lang.c:94749 BartC writes: > On 11/10/2016 20:18, Keith Thompson wrote: >> 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. > > I'm sure this amount of pedantry is going to be really helpful 55 > seconds into a nearly five-hour video. If someone wasn't quite ready to > turn it off, or go to sleep, this will improve the chances! I know the video was the starting point for this thread, but I haven't watched it and I wasn't commenting on it. I wasn't even commenting on the use of the phrase "pointer variable". All I was talking about was whether the word "address", as used in the standard, applies to a null pointer value. [...] -- 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"