Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 10 Jan 2013 00:42:01 +0100
From: Szabolcs Nagy <>
Subject: Re: NULL

* Rich Felker <> [2013-01-09 10:36:30 -0500]:
> question: short of C11 _Generic, is it even possible for a program to
> detect whether NULL has integer or pointer type?

if it's ok to detect at compile time then it's easy:

int a = -NULL;
int b = NULL+NULL;
int c = NULL+.0f;
int d[NULL+1];
int e = 0?NULL:1;

these are compile time errors if NULL has pointer type
but ok when NULL is integer

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.