C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 25 Jul 2025 12:38:20 -0700
On Friday, 25 July 2025 11:31:14 Pacific Daylight Time Oliver Hunt via Std-
Proposals wrote:
> > I think you're suggesting it might be false if a nullptr is represented in
> > memory by all bits 1.
> >
> > Which has never happened. Never ever.
>
> That’s objectively wrong: https://c-faq.com/null/machexamp.html

And pointer to data members.

struct S
{
    int S:: *ptr;
} s = {};

https://gcc.godbolt.org/z/fzajq75oq

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

Received on 2025-07-25 19:38:26