C++ Logo


Advanced search

Re: [wg14/wg21 liaison] P2961R1 syntax for Contracts: viable for C?

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Fri, 6 Oct 2023 02:02:21 +0300
On Thu, 5 Oct 2023 at 20:50, Martin Uecker via Liaison
<liaison_at_[hidden]> wrote:
> > WG21 does not want contract annotations to be ignorable in the same
> > way as attributes (both in terms of allowing an implementation to not
> > support contracts and in terms of not allowing syntactic errors in the
> > arguments to the contract), so that would be a very poor fit.
> Ah, right, I forgot that this was a design goal.
> (The problem is that this will make it much harder for C projects
> to usefully adopt it.)

WG14 doesn't necessarily need to set that design goal for itself even
if WG21 might. It's unclear to me whether
that design goal is the right choice for the ecosystem of C.

It wouldn't cause me loss of sleep if C compilers were allowed to
completely ignore a contract annotation.
Fixing syntax errors when using a compiler that doesn't ignore them is
compatible with compilers that would
ignore the annotations.

Received on 2023-10-05 23:02:34