Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130109234200.GN4468@port70.net>
Date: Thu, 10 Jan 2013 00:42:01 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: NULL

* Rich Felker <dalias@...ifal.cx> [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

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