C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Standardising 0xdeadbeef for pointers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 31 Jul 2025 11:56:54 -0700
On Thursday, 31 July 2025 11:23:17 Pacific Daylight Time Andrey Semashev via
Std-Proposals wrote:
> On 31 Jul 2025 21:24, zxuiji via Std-Proposals wrote:
> > After seeing all this nonsense I sure am glad I never have to deal with
> > it since I stick to C where sanity reigns... at least until your foot
> > gets shot XD
>
> If you think C is different wrt. pointer definition, think again.

More to the point, where do you think C++ got the definition and behaviour
from?

https://cigix.me/c17#6.5.6.p8
"If both the pointer operand and the result point to elements of the same
array object, or one past the last element of the array object, the evaluation
shall not produce an overflow; otherwise, the behavior is undefined."

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

Received on 2025-07-31 18:56:59