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



On Mar  3, 1999, Gabriel Dos Reis <Gabriel.Dos-Reis@dptmaths.ens-cachan.fr> wrote:

> NULL is *not* a pointer. NULL is _convertible_ to pointer type. More
> explicitly, the C++ Standard says:

> 4.10/1
> ---
>   A null pointer constant is na integral expression (5.19) rvalue of
>   integer type that evaluates to zero.
> ---

> So NULL is of integer type. Exactly wich one is implementation-defined.

Actually, it needs not be an integer type; the definition

enum __NULL_type { __null = 0 };
#define NULL __null

is a valid one, because integral expressions may involve enumerators.

-- 
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