From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14390 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Define NULL as __null in C++ mode when using GCC or Clang. Date: Wed, 10 Jul 2019 23:44:07 +0200 Message-ID: <20190710214407.GN21055@port70.net> References: <20190709193826.GR1506@brightrain.aerifal.cx> <20190710020357.GI21055@port70.net> <871ryycs9n.fsf@oldenburg2.str.redhat.com> <20190710164446.GS1506@brightrain.aerifal.cx> <20190710204812.GV1506@brightrain.aerifal.cx> <20190710211154.GL21055@port70.net> <20190710211624.GX1506@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="205172"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) To: musl@lists.openwall.com Original-X-From: musl-return-14406-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 10 23:44:22 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hlKNx-000rH1-QU for gllmg-musl@m.gmane.org; Wed, 10 Jul 2019 23:44:21 +0200 Original-Received: (qmail 32626 invoked by uid 550); 10 Jul 2019 21:44:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 32608 invoked from network); 10 Jul 2019 21:44:19 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20190710211624.GX1506@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:14390 Archived-At: * Rich Felker [2019-07-10 17:16:24 -0400]: > > i think modern c++ code should use nullptr in the code. > > > > definition of NULL should be imo kept as 0L (that's what > > you would get on older unix systems or on openbsd anyway) > > apparently some ppl prefer __null. > > Do you know if OpenBSD has a reason they do it this way? hm i misremembered and they changed it anyway https://github.com/openbsd/src/blob/master/sys/sys/_null.h openbsd used to define NULL as 0L for both c and c++, then they changed it to __null if __GNUG__ and 0L and (void*)0 for c++ and c, now it's even more complicated. maybe it was some other bsd or solaris that used 0L i remember looking at it last time we changed NULL.