From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2307 invoked from network); 23 Dec 2021 22:00:39 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 23 Dec 2021 22:00:39 -0000 Received: (qmail 15410 invoked by uid 550); 23 Dec 2021 22:00:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 15377 invoked from network); 23 Dec 2021 22:00:36 -0000 Date: Thu, 23 Dec 2021 23:01:01 +0100 From: Ismael Luceno To: Rich Felker Cc: Colin Cross , musl@lists.openwall.com Message-ID: References: <20211223210521.GR7074@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211223210521.GR7074@brightrain.aerifal.cx> Subject: Re: [musl] Re: [PATCH] Define NULL as nullptr when used in C++ On 23/Dec/2021 16:05, Rich Felker wrote: > On Thu, Dec 23, 2021 at 11:13:01AM -0800, Colin Cross wrote: <...> > > This also meets the C++ spec for NULL [1], but is an improvement over > > the previous 0L because it can be correctly interpreted as a NULL > > sentinel value by Clang's -Wsentinel warning. > > > > Ismael, can you give an example of the code that assumes NULL is a > > pointer? Does it work with __null (assuming you're using a compiler > > that has GNU extensions like __null)? I think there was a discussion about __null before, wasn't it? Even if nobody had an opinion on it, I would still try to avoid an extension if there's alternatives... > I don't think the main aim here is to support code that wrongly > assumes NULL has pointer type, but to catch wrong code that's assuming > it doesn't or just accidentally doing something even more wrong. > Avoiding the warning spam compiling GCC itself is kinda nice but it's > a bonus. > > > In any case, I'll fix the technically incorrect code I have access to > > so that it works with nullptr. > > Sounds like a good plan. +1