mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Ismael Luceno <ismael@iodev.co.uk>
To: Rich Felker <dalias@libc.org>
Cc: Colin Cross <ccross@google.com>, musl@lists.openwall.com
Subject: Re: [musl] Re: [PATCH] Define NULL as nullptr when used in C++
Date: Thu, 23 Dec 2021 23:01:01 +0100	[thread overview]
Message-ID: <YcTxnQtywNB7i+7C@pirotess> (raw)
In-Reply-To: <20211223210521.GR7074@brightrain.aerifal.cx>

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

  reply	other threads:[~2021-12-23 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23 19:13 Colin Cross
2021-12-23 21:05 ` Rich Felker
2021-12-23 22:01   ` Ismael Luceno [this message]
2021-12-24  1:28   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YcTxnQtywNB7i+7C@pirotess \
    --to=ismael@iodev.co.uk \
    --cc=ccross@google.com \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).