From -5871882637237488127
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f1dec9ce20a9c98f
X-Google-Attributes: gidf78e5,public
From: stanley@West.Sun.COM (Stanley Friesen [Contractor])
Subject: Re: null pointers (was: Why's of C++ -- Part 1)
Date: 1999/08/18
Message-ID: <7pcoem$105@abyss.West.Sun.COM>#1/1
X-Deja-AN: 514097022
X-Nntp-Posting-Host: ba2.west.sun.com
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <7opqvm$vpa$1@news.hal-pc.org> <p6qn1vvob7z.fsf@informatik.hu-berlin.de> <D0eVh8AJVXt3Ewfo@robinton.demon.co.uk> <37B7C714.44E4EFB4@lucent.com>
Organization: SunSoft South, Los Angeles, CA
X-UID: 0000000001
X-Status: $$$T
Newsgroups: comp.std.c++
Originator: clamage@taumet


In article <37B7C714.44E4EFB4@lucent.com>, Salters  <salters@lucent.com> wrote:
>
>Francis Glassborow wrote:
>> Why?  Could we not revisit the decision in the next version of C++?  Can
>> anyone give a good reason why making (void *)0 a special case would be a
>> problem.  BTW I would require exactly that C style cast mechanism.
>
>Would that make the following code legal:
>
>const int i=0;
>char *pc=(void*)i;

If I had my way: no, never.

The special case would be exactly and only the token sequence "(void *)0".
There is no reason to extend it to integers that happen to have the value
zero.  That is not particularly useful.

The specified token sequence should be specified to be the null-pointer
constant, and be implicitly convertable into any object pointer type,
generating the null pointer of that type.

The conversion of the integral constant 0 (zero) to a null pointer should
also be maintained for compatibility, though it might well be deprecated.


[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




