C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D3666R0 Bit-precise integers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 09 Sep 2025 23:00:16 -0700
On Tuesday, 9 September 2025 20:17:55 Pacific Daylight Time Halalaluyafail3 via
Std-Proposals wrote:
> Firstly, 0z is signed so it can't be any of those.

Yes, sorry, I meant 0zu is one of those (in practice) and 0z is 0, 0L or 0LL
(in practice)

> 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.

In theory, yes. In practice, it's one of the three types I mentioned.
Specifically, it must be one of the integer types, whether standard or
extended.

> 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.

+0 is an expression, not a literal, so that doesn't count.

> 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.

I'm not passing judgement on 0wb. I'm saying that 0z and 0zu are literals no
different than any of the other literal 0 constants and in 100% of existing
platforms they are exactly the same as one of the constants.

All I am saying is that there are enough differences that one can't use 0z and
0zu being allowed as null pointer constants to argue for 0wb also being so.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-09-10 06:00:33