 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Me Guest
|
Posted: Thu May 19, 2005 3:10 pm Post subject: Defect Report: C++ doesn't allow null void pointer value con |
|
|
[ Note: Forwarded to C++ Committee. -sdc ]
The C standard says: 6.3.2.3/4 Conversion of a null pointer to another
pointer type yields a null pointer of that type. Any two null pointers
shall compare equal.
C++ appears to be incompatible with the first sentence in only two
areas:
A *a = 0;
void *v = a;
C++(4.10/2) says nothing about the value of v
void *v = 0;
A *b = (A*)v; // aka static_cast<A*>(v)
C++(5.2.9/10) says nothing about the value of b.
Proposed changes:
1. Add the following sentence to 4.10/2: "The null pointer value is
converted to the null pointer value of the destination type."
2. Add the following sentence to 5.2.9/10: "The null pointer value
(4.10) is converted to the null pointer value of the destination type."
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|