From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2572 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: NULL Date: Mon, 14 Jan 2013 01:11:35 -0500 Message-ID: <20130114061135.GM20323@brightrain.aerifal.cx> References: <20130113174731.GS4468@port70.net> <1358106388.32505.17@driftwood> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1358143910 16507 80.91.229.3 (14 Jan 2013 06:11:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Jan 2013 06:11:50 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2573-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jan 14 07:12:07 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TudHD-0007Ls-7o for gllmg-musl@plane.gmane.org; Mon, 14 Jan 2013 07:12:07 +0100 Original-Received: (qmail 3595 invoked by uid 550); 14 Jan 2013 06:11:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3587 invoked from network); 14 Jan 2013 06:11:50 -0000 Content-Disposition: inline In-Reply-To: <1358106388.32505.17@driftwood> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2572 Archived-At: On Sun, Jan 13, 2013 at 01:46:28PM -0600, Rob Landley wrote: > On 01/13/2013 11:47:32 AM, Szabolcs Nagy wrote: > >> So I think you're saying is that the behavior I'm depending on > >changed? > > > >well, > > > >(int)(void*)0 is not an "integer constant expression" and it > >is not a "null pointer constant", > > C99 6.3.2.3: An integer constant expression with the value 0, or > such an expression cast to type void *, is called a null pointer > constant. > > 7.17 #3: The macros are NULL which expands to an > implementation-defined null pointer constant; > > So it uses "constant" in the name but either it's not a constant or > typecasting it twice makes it stop being a constant. Basically, the latter. It may still be a constant, but it's neither an integer constant expression (this is a very restricted category of expressions) not a null pointer constant. In any case, this thread has gotten WAY off-topic, going all over the place into territory about the merits and demerits of different languages and anti-FSF politics. Those topics may be worth discussing in some contexts, but it seems to have left everybody really confused about the issues at hand, which are: - whether we should work around broken programs that pass NULL to variadic functions - and if so, how The emerging consensus seems to be using #define NULL 0L unconditionally in both C and C++ mode. Rich