C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Make all data pointers intercompatible

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 09 May 2024 08:50:38 -0700
On Thursday 9 May 2024 03:42:04 GMT-7 Frederick Virchanza Gotham via Std-
Proposals wrote:
> The smallest addressable unit of memory that the CPU can read or write
> is actually 16 bits, however the compiler is hiding this fact. The
> compiler has set CHAR_BIT==8, and so whenever it encounters a char*,
> the compiler needs a memory address combined with an offset, and so
> there are two possibilities:
>
> Possibility 1: sizeof(char*) > sizeof(int*)
> Possibility 2: sizeof(char*) == sizeof(int*) (but the latter
> has extra bits always set to zero)

Right.

What's the problem?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Principal Engineer - Intel DCAI Cloud Engineering

Received on 2024-05-09 15:50:46