Date: Mon, 20 Sep 2021 11:57:08 -0400
On Mon, Sep 20, 2021 at 11:15 AM Ville Voutilainen via Liaison
<liaison_at_[hidden]> wrote:
>
> On Mon, 20 Sept 2021 at 18:02, Aaron Ballman via SG21
> <sg21_at_[hidden]> wrote:
> > There are compilers for which the implementation strategy for all
> > attributes is to note the [[ that opens an attribute specifier, eat
> > all balanced tokens up to the closing ]], and diagnose the entire bit
> > as "attribute ignored" (as a warning). You cannot do that with
> > contracts because a correct program does not remain correct when the
> > contract is ignored. A program can correctly rely on the contract
> > violation handler executing, and that's not the case with this
> > implementation strategy.
>
> That's not a conforming strategy. A compiler needs to parse the
> attribute grammar, and that grammar doesn't
> allow arbitrary tokens as a balanced-token-sequence outside an
> attribute-argument-clause, as specified
> in 6.7.11.1 in the C working draft.
It is a conforming strategy because of the laxity in what diagnostics
are required for conformance. "attribute ignored" is a low-quality
diagnostic for [[12]] but is still a conforming implementation. The
issue with contracts is that there are additional semantics that can't
be ignored.
~Aaron
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Link to this post: http://lists.isocpp.org/liaison/2021/09/0724.php
<liaison_at_[hidden]> wrote:
>
> On Mon, 20 Sept 2021 at 18:02, Aaron Ballman via SG21
> <sg21_at_[hidden]> wrote:
> > There are compilers for which the implementation strategy for all
> > attributes is to note the [[ that opens an attribute specifier, eat
> > all balanced tokens up to the closing ]], and diagnose the entire bit
> > as "attribute ignored" (as a warning). You cannot do that with
> > contracts because a correct program does not remain correct when the
> > contract is ignored. A program can correctly rely on the contract
> > violation handler executing, and that's not the case with this
> > implementation strategy.
>
> That's not a conforming strategy. A compiler needs to parse the
> attribute grammar, and that grammar doesn't
> allow arbitrary tokens as a balanced-token-sequence outside an
> attribute-argument-clause, as specified
> in 6.7.11.1 in the C working draft.
It is a conforming strategy because of the laxity in what diagnostics
are required for conformance. "attribute ignored" is a low-quality
diagnostic for [[12]] but is still a conforming implementation. The
issue with contracts is that there are additional semantics that can't
be ignored.
~Aaron
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Link to this post: http://lists.isocpp.org/liaison/2021/09/0724.php
Received on 2021-09-20 10:58:33