Date: Thu, 23 Sep 2021 11:51:41 +0200
On Wed, Sep 22, 2021 at 8:31 PM Jāāā Gustedt via SG21
<sg21_at_[hidden]> wrote:
>
> That is done with proper syntax using a keyword in C.
>
> And, IIRC what I've read, that's one of the reasons introducing
> attributes to C failed at the first attempt for C11. And also, this
> seems to be why other languages integrate such a property in the type
> system.
Indeed -- e.g. Rust provides a `!` type for that.
In fact, in the example above, returning an `int` does not make sense
for a `[[noreturn]]` function.
Cheers,
Miguel
<sg21_at_[hidden]> wrote:
>
> That is done with proper syntax using a keyword in C.
>
> And, IIRC what I've read, that's one of the reasons introducing
> attributes to C failed at the first attempt for C11. And also, this
> seems to be why other languages integrate such a property in the type
> system.
Indeed -- e.g. Rust provides a `!` type for that.
In fact, in the example above, returning an `int` does not make sense
for a `[[noreturn]]` function.
Cheers,
Miguel
Received on 2021-09-23 04:51:53