Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA2zVHoXd+ezWmZVWhgoXKVid6voSpGGJjmeie04uL+igSBw3w@mail.gmail.com>
Date: Wed, 10 Jul 2019 12:18:11 -0400
From: James Y Knight <jyknight@...gle.com>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Define NULL as __null in C++ mode when using GCC
 or Clang.

On Wed, Jul 10, 2019 at 2:34 AM Florian Weimer <fweimer@...hat.com> wrote:

> * Szabolcs Nagy:
>
> > it is clear that 0L is a conforming definition for all
> > conforming c++ compilers.
> >
> > it is less clear if __null is so in all compilers that
> > define __GNUC__.
>
> Why wouldn't something like this be valid for current C++ versions?
>
> static inline constexpr decltype(nullptr) __null{};
> #define NULL __null
>
> I don't see a requirement that NULL must be an expression that can be
> evaluated by the preprocessor.


Is this just for the purposes of argument, or, why would you want to do
that? More sanely, yes, `#define NULL nullptr` would now also be a
conforming definition, but that is an undesirable change in practice for a
variety of compatibility reasons. Toolchains have remained with `#define
NULL __null`, and seem likely to continue to do so indefinitely.

I feel like this thread is kinda going off on a tangent now. Inventing new
and unique ways to define NULL in C++ doesn't really seem a useful thing to
do be doing here...

Content of type "text/html" skipped

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.