Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YcTxnQtywNB7i+7C@pirotess>
Date: Thu, 23 Dec 2021 23:01:01 +0100
From: Ismael Luceno <ismael@...ev.co.uk>
To: Rich Felker <dalias@...c.org>
Cc: Colin Cross <ccross@...gle.com>, musl@...ts.openwall.com
Subject: Re: 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

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.