C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Defect Report: C++ doesn't allow null void pointer value con

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Me
Guest





PostPosted: Thu May 19, 2005 3:10 pm    Post subject: Defect Report: C++ doesn't allow null void pointer value con Reply with quote




[ 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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.