C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] How to handle conflicting 'unreachable' definitions

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Thu, 4 Apr 2024 16:58:29 +0200
Ville,

on Thu, 4 Apr 2024 17:30:26 +0300 you (Ville Voutilainen via Liaison
<liaison_at_[hidden]>) wrote:

> On Thu, 4 Apr 2024 at 16:15, Aaron Ballman via Liaison
> <liaison_at_[hidden]> wrote:

> My spec-squinting suggests that the answer to (1) is yes. The
> normative reference to C comes with a date, it refers to C18. I
> therefore would not expect C++23 to bring in C23 entities.
>
> That is also my technical preference; it's ostensibly so that that
> particular version of C has been figured out how to make it work
> with that particular version of C++, and newer versions of C simply
> might not work.

fair point

> Why, for heaven's sake, is 'unreachable' a macro in C?

I don't know what the heavens have to do with it, but as you know C
has its own objectives and traditions.

From memory, there were two objectives:

- make the feature testable

- make it easy for C library providers (usually different from
  compiler implementors) to implement it on top of existing features
  such as `__builtin_unreachable`.

> That is instant trouble for C++, where every user expects to be able
> to scope names via namespaces.

indeed, and including <stddef.h> instead of <cstddef> in a C++ source
is probably not such a good idea, anyhow.

(And I observe to my complete surprise that <cstddef> even includes
one feature of C23 by having used a time machine in 2011, and two
features that do not originate from <stddef.h> and that probably will
never go into C. weird.)

Jₑₙₛ

-- 
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2024-04-04 14:58:33