| To: | austin-group-l@xxxxxxxxxxxxx |
|---|---|
| Subject: | Terminology: "null pointer" vs NULL |
| From: | Vincent Lefevre <vincent-opgr@xxxxxxxxxx> |
| Date: | Thu, 26 Jul 2007 18:10:26 +0200 |
| Mail-followup-to: | austin-group-l@xxxxxx |
In the latest draft (Issue 7 Draft 3), the standard uses various
wordings for a null pointer: "null pointer" (this is correct), but
also "NULL" and derivatives ("NULL pointer" and so on).
Why all these wordings?
Is this deliberate?
Note that the ISO C99 standard only uses the term "null pointer"
("NULL" being a macro). And I think that saying "NULL" instead of
"null pointer" is incorrect because:
* in C, NULL does not necessarily evaluate to a pointer (though
Issue 7 requires that, more precisely the type must be void *),
* all pointers do not have the type void *;
* (void *) 0 is a constant whereas not all null pointers are
constants. So, something like "functions need not be thread-safe
if passed a NULL argument" would not apply when the argument is
a non-constant null pointer (if the function is implemented as
a macro, the compiler can make the difference between constant
values and non-constant values).
You can see a discussion I have with Michael Kerrisk here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=431480
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: BUG in XSHd3 getaddrinfo, Vincent Lefevre |
|---|---|
| Next by Date: | Re: Bug in XCUd3 continue, Glenn Fowler |
| Previous by Thread: | Re: Bug in XSHd3 malloc, Eric Blake |
| Next by Thread: | Re: Bug in XCUd3 continue, Glenn Fowler |
| Indexes: | [Date] [Thread] [All Lists] |