C++ Logo

liaison

Advanced search

Re: [isocpp-wg14/wg21-liaison] [SC22WG14.26034] constexpr atomic in C++ compatibility concerns

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Thu, 27 Jun 2024 16:00:56 +0200
Hi,

on Thu, 27 Jun 2024 08:42:07 -0500 you (Nina Dinka Ranns via Liaison
<liaison_at_[hidden]>) wrote:

> > I'm author of P3309 "constexpr atomic<T> and atomic_ref<T>" (
> > https://isocpp.org/files/papers/P3309R1.html) in C++. And LEWG is
> > concerned about compatibility of constexpr free functions with C's
> > atomic. Is there any work being done on constexpr atomic or any
> > feedback for me regarding compatibility?
> >
> > Hana Dusíková

The paper is a bit short on motivation, so it is difficult to see
where this would go (or be relevant) from a C perspective.

- We don't have `constexpr` functions in C, yet.
- We don't have `consteval` in C, yet.
- Headers for these functions are not shared between C and C++. So if
  C++ may have certain expectations about functions, C could still
  not allow them where C++ does.

In general I have the impression that C is mostly satisfied with
initializers for all what concerns atomics, `atomic_init` only has
marginal use.

Having this on `atomic_flag` functions, which, by definition do not
have value but only state, looks weird to me.

I also note from the interfaces that are listed, that C++ already
seems to have extended the atomic interfaces to the notification
features. I am not sure that we have seen these in the liaison group
(but I might be mistaken) and I would personally find it a good idea
to port them to C, if that is possible.


Thanks
Jₑₙₛ

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

Received on 2024-06-27 14:00:59