C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [isocpp-sg21] Telecon to review P2388R1 Minimum Contract Support: either Ignore or Check_and_abort

From: Ryan McDougall <mcdougall.ryan_at_[hidden]>
Date: Mon, 20 Sep 2021 12:44:05 -0700
We really need to be better at explaining our use cases to the degree that
we can be reasonably sure that everyone understands exactly what the
objection is. So far we've seen threats to vote against and raise NB
comments and it's not clear that there is a consensus understanding why.

It's not surprising that a bunch of self-selected C++ developers aren't too
worried about C-compatibility sans context, but if we can actually uncover
the context, I'm sure we'd do our best to allay those concerns as much as
is feasible.

I also agree with John that proposals don't need to be arbitrarily sent to
any number of rooms just in case there's a concern, or spend an unbounded
amount of time in those rooms without a fuller explanation.

Let's also not lose context: we're not making just another feature -- this
one is almost certain to be used in a car or plane your children will be
using in the near future. If there's one thing functional safety engineers
are good at, it's making sure they know what version of a language they're
using, and it's properly matched to the right compiler. We'd definitely
like to not have old compilers silently eat contracts, but there's only so
much we can do in the face of a (unintentionally) hostile user.

Aaron, Peter -- is it possible to submit a quick D-paper outlining your
case in time for October 5th telecon?

Cheers,

On Mon, Sep 20, 2021 at 12:22 PM Jens Maurer <Jens.Maurer_at_[hidden]> wrote:

> On 20/09/2021 21.17, Uecker, Martin via Liaison wrote:
> > Am Montag, den 20.09.2021, 19:47 +0300 schrieb Ville Voutilainen via
> Liaison:
> >> On Mon, 20 Sept 2021 at 19:37, Ryan McDougall via SG21
> >> <sg21_at_[hidden]> wrote:
> >>> Can you help me understand the concern here -- is it that C will have
> to update its grammar to
> >>> recognize this syntax as not ignorable, and they would rather not?
> >>
> >> I can't speak for Aaron's concerns, but based on his excellent
> >> explanation, I have mine, which I'd wager are mighty similar to his:
> >>
> >> 1) our design goal for the syntax is that it's sufficiently
> >> incompatible so that older compilers don't just half-accidentally
> >> ignore-chomp it.
> >> 2) we're failing to meet that design goal, because an older C-compiler
> >> can ignore-chomp it and diagnose it
> >> as "attribute ignored". The syntax is not sufficiently different for a
> >> conforming older C-compiler not to mistreat
> >> it, and we fail to achieve the goal of a compiler syntax-checking the
> >> contract annotation.
> >> 3) in other words, the C compiler took our program, and treated it in
> >> a conforming way, it diagnosed a syntax
> >> error with a very misleading diagnostic, but was fully-conforming all
> the way.
> >
> > Is this somehow different to old C++ compilers?
>
> Really old C++ compilers will see "[[" and complain about
> token soup.
>
> I haven't seen a C++ compiler (of any age) that would
> recognize "[[" but then ignore contained attribute
> entirely.
>
> Jens
>

Received on 2021-09-20 14:44:19