Date: Tue, 9 Sep 2025 23:17:55 -0400
> 0z is not a new type. It's the same as either 0U, 0UL, or 0ULL, depending on
> the platform, all of which are already currently allowed to be a null pointer
> constant.
Firstly, 0z is signed so it can't be any of those. Secondly, assuming you meant
the signed versions it still isn't true since size_t could for example be
unsigned short or an extended integer type. Thirdly, whether something is a null
pointer constant doesn't just depend upon the type and it being a constant
expression. As an example, +0 is not a null pointer constant. So, if 0z not
being a null pointer constant was important they could've prevented it from
being one. There just isn't any significant motivation to specifically prohibit
it, and I don't see any significant motivation to prohibit it for 0wb as well.
On Tue, Sep 9, 2025 at 10:10 PM Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> On Tuesday, 9 September 2025 18:24:05 Pacific Daylight Time Halalaluyafail3 via
> Std-Proposals wrote:
> > C++ allows 0z as a null pointer constant, what's the reason to need to be
> > more strict in this regard?
>
> 0z is not a new type. It's the same as either 0U, 0UL, or 0ULL, depending on
> the platform, all of which are already currently allowed to be a null pointer
> constant.
>
> Bit-precise integers are a new type. They can have new conversion and
> promotion rules.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel Platform & System Engineering
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
> the platform, all of which are already currently allowed to be a null pointer
> constant.
Firstly, 0z is signed so it can't be any of those. Secondly, assuming you meant
the signed versions it still isn't true since size_t could for example be
unsigned short or an extended integer type. Thirdly, whether something is a null
pointer constant doesn't just depend upon the type and it being a constant
expression. As an example, +0 is not a null pointer constant. So, if 0z not
being a null pointer constant was important they could've prevented it from
being one. There just isn't any significant motivation to specifically prohibit
it, and I don't see any significant motivation to prohibit it for 0wb as well.
On Tue, Sep 9, 2025 at 10:10 PM Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> On Tuesday, 9 September 2025 18:24:05 Pacific Daylight Time Halalaluyafail3 via
> Std-Proposals wrote:
> > C++ allows 0z as a null pointer constant, what's the reason to need to be
> > more strict in this regard?
>
> 0z is not a new type. It's the same as either 0U, 0UL, or 0ULL, depending on
> the platform, all of which are already currently allowed to be a null pointer
> constant.
>
> Bit-precise integers are a new type. They can have new conversion and
> promotion rules.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel Platform & System Engineering
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-09-10 03:18:40