C++ Logo

liaison

Advanced search

Re: [isocpp-wg14/wg21-liaison] WG14 N3197 Accessing arrays of character type

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Sun, 11 May 2025 10:10:42 +0200
Hi Jens,

on Sun, 11 May 2025 09:23:15 +0200 you (Jens Maurer via Liaison
<liaison_at_[hidden]>) wrote:

> The above-captioned paper introduces "byte arrays" and "byte types"
> into C2y to deal with certain memory model concerns.
> The term "byte type" includes signed chars.
>
> That's a deviation from C++, where "signed char" is never among the
> types granting special byte-like behavior in the memory model.

In C it is included into "character types" that have these properties.

> Was there any express desire by WG14 to include "signed char",

not explicitly

> or could we remove "signed char" from the "byte" definition in C?

no, most certainly not, that would be a normative change and would
invalidate existing C programs

the intent of that paper was not to do any such normative change

> (I think this rule would cause optimizers to assume that "signed
> char*" can alias anything, pessimizing code generation.)

That is status quo in C.

(So again one of these useless difference in the memory model, what a mess.)

Thanks
Jₑₙₛ

-- 
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA antenne de Strasbourg :::::::::::::::::: Camus ::
:: INRIA PIQ program Strasbourg :::::::::: piq.inria.fr ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2025-05-11 08:10:45