Date: Mon, 17 May 2021 14:46:51 +0200
Aaron,
on Mon, 17 May 2021 07:01:33 -0400 you (Aaron Ballman
<aaron_at_[hidden]>) wrote:
> On Sun, May 16, 2021 at 6:13 AM Jₑₙₛ Gustedt via Liaison
> <liaison_at_[hidden]> wrote:
> >
> > Hello,
> > it seems that C++ has integrated
> >
> > https://wg21.link/p0627
> >
> > into C++20. This provides a pseudo-function `unreachable` where a
> > call indicates that the whole path in the control flow that reaches
> > it can never be taken.
> >
> > Is there interest / attempt / opposition of porting this feature to
> > C?
>
> Personally, I'm in favor of the idea -- the proposed functionality
> applies in C with the same general rationale (alongside similar C
> functionality as _Noreturn and assert), and it would be handy to add
> this functionality to C's toolbox.
Great, so far the only reactions that I have been seeing here are
favorable. In contrast to that, the state of the proposal is somehow
unknown? Is there a way to know better where this is stuck, currently?
If I see correctly, for the design of such features there are
basically two alternatives
- mark the path in the control flow as `unreachable` (as a pseudo
function or as an attribute)
- have a macro with condition such as `assume`.
I personally see the advantages and disadvantages of both. Also, they
are not really far apart from each other and each can easily be
emulated by the other.
If `unreachable` would be relatively advanced in the process for C++,
I would not even like to spend too much time on `assume`;
`unreachable` has the advantage of being implemented in many compilers
with just other names, also in C mode.
If not, indeed we could start thinking about a common design of a
feature.
Thanks
Jₑₙₛ
on Mon, 17 May 2021 07:01:33 -0400 you (Aaron Ballman
<aaron_at_[hidden]>) wrote:
> On Sun, May 16, 2021 at 6:13 AM Jₑₙₛ Gustedt via Liaison
> <liaison_at_[hidden]> wrote:
> >
> > Hello,
> > it seems that C++ has integrated
> >
> > https://wg21.link/p0627
> >
> > into C++20. This provides a pseudo-function `unreachable` where a
> > call indicates that the whole path in the control flow that reaches
> > it can never be taken.
> >
> > Is there interest / attempt / opposition of porting this feature to
> > C?
>
> Personally, I'm in favor of the idea -- the proposed functionality
> applies in C with the same general rationale (alongside similar C
> functionality as _Noreturn and assert), and it would be handy to add
> this functionality to C's toolbox.
Great, so far the only reactions that I have been seeing here are
favorable. In contrast to that, the state of the proposal is somehow
unknown? Is there a way to know better where this is stuck, currently?
If I see correctly, for the design of such features there are
basically two alternatives
- mark the path in the control flow as `unreachable` (as a pseudo
function or as an attribute)
- have a macro with condition such as `assume`.
I personally see the advantages and disadvantages of both. Also, they
are not really far apart from each other and each can easily be
emulated by the other.
If `unreachable` would be relatively advanced in the process for C++,
I would not even like to spend too much time on `assume`;
`unreachable` has the advantage of being implemented in many compilers
with just other names, also in C mode.
If not, indeed we could start thinking about a common design of a
feature.
Thanks
Jₑₙₛ
-- :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::
Received on 2021-05-17 07:46:59