This is the mail archive of the
egcs@egcs.cygnus.com
mailing list for the EGCS project. See the EGCS
home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]
Re: C++ definition of NULL
- To: "Doug Semler" <doug@seaspace.com>
- Subject: Re: C++ definition of NULL
- From: Alexandre Oliva <oliva@dcc.unicamp.br>
- Date: 03 Mar 1999 17:30:31 -0300
- Cc: "Gabriel Dos Reis" <Gabriel.Dos-Reis@dptmaths.ens-cachan.fr>, "Chad Gatesman" <chadg@redrose.net>, "Jason Merrill" <jason@cygnus.com>, <egcs@cygnus.com>
- Delivered-To: listarch-egcs@egcs.cygnus.com
- Delivered-To: mailing list egcs@egcs.cygnus.com
- In-Reply-To: "Doug Semler"'s message of "Wed, 3 Mar 1999 11:07:15 -0800"
- Mailing-List: contact egcs-help@egcs.cygnus.com; run by ezmlm
- References: <01be01be65a9$0d1c00d0$237196c0@seaspace.com>
- Sender: owner-egcs@egcs.cygnus.com
- Sender: oliva@araguaia.dcc.unicamp.br
- User-Agent: Gnus/5.070079 (Pterodactyl Gnus v0.79) XEmacs/20.4 (Emerald)
On Mar 3, 1999, "Doug Semler" <doug@seaspace.com> wrote:
> So the way I read the standard, the type of a null pointer constant is
> a pointer type of pointer to destination's cv-qualified type.
> eg:
> int *a = NULL ; // NULL has type int *
> int a = NULL; // Error: cannot implicitly convert pointer type to int
> Right?????
Nope. Since NULL is an integral expression, it can be converted to
int, so there's no error above.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil