Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: What is the data structure of a NULL? Date: Tue, 31 Dec 2019 11:11:17 -0800 Organization: None to speak of Lines: 30 Message-ID: <87a778pay2.fsf@nosuchdomain.example.com> References: <87sgl4rc3w.fsf@nosuchdomain.example.com> <87o8vsqh5l.fsf@nosuchdomain.example.com> <87k16fr9za.fsf@nosuchdomain.example.com> <91dfd68d-0094-4edf-bef1-31bf55b24aa1@googlegroups.com> <20191231152044.3d1b42adddc2a58c4520fa35@cvine--nospam--.freeserve.co.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="94fc4d7fa52f8ea4ccffaf50350c18bf"; logging-data="32520"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qh513bm9RZ/K4f82V2XIQ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:jCNE2oDkXxkNsZ6DxjT2q4vQ8Vo= sha1:DmoBfKrTcJwwP6E/rsdBOTWp0dY= Xref: csiph.com comp.lang.c++:70903 Chris Vine writes: [...] > You have a point so far as concerns, say, memset'ing structs of > trivial type to all-bits-zero where those structs contain pointers > which you want to be NULL (should your code actually do that). But you null, not NULL. > are completely wrong in your example above. 'array' will be a null > pointer constant if calloc fails, and the test for falsity will work > correctly irrespective of whether the null pointer constant is > signalled by all-bits-zero. 'array' will be a null pointer, not a null pointer constant. A *null pointer constant* is a source code construct (and NULL is a macro that expands to a null pointer constant). A *null pointer* is a value that can exist at run time. It's probably OK in most cases to use the term "NULL" to refer to a null pointer value, but in this case the distinction is a large part of what we're talking about, so I suggest being a bit more pedantic than usual. > You have something wrong with your mental image of this. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com [Note updated email address] Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */