From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2539 Path: news.gmane.org!not-for-mail From: Luca Barbato Newsgroups: gmane.linux.lib.musl.general Subject: Re: NULL Date: Wed, 09 Jan 2013 15:42:07 +0100 Message-ID: <50ED81BF.8030005@gentoo.org> References: <50ED4E45.6050801@barfooze.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1357742544 9930 80.91.229.3 (9 Jan 2013 14:42:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jan 2013 14:42:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2540-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 09 15:42:42 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 1TswrY-0003cw-93 for gllmg-musl@plane.gmane.org; Wed, 09 Jan 2013 15:42:40 +0100 Original-Received: (qmail 17502 invoked by uid 550); 9 Jan 2013 14:42:24 -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 17491 invoked from network); 9 Jan 2013 14:42:23 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <50ED4E45.6050801@barfooze.de> X-Enigmail-Version: 1.4.6 Xref: news.gmane.org gmane.linux.lib.musl.general:2539 Archived-At: On 09/01/13 12:02, John Spencer wrote: > 2) change musl so it is compatible with those apps. this would mean: > #if defined(__GNUC__) && defined(__cplusplus__) > #define NULL __null > #elif defined (__cplusplus__) > #define NULL 0 > #else > #define NULL (void *) 0 /* for C code */ > #end > this change is the easiest solution: any problem will be magically fixed. I'm not sure if there is a way to warn properly at compile time for that specific usage. IMHO going with 2+3 is the only safe way to grant musl more support Having a flag to turn those compatibility hacks off would be good. I wonder why in the hell C++ can't use the (void *) 0 definition or equivalent. lu