220 31576 <51fa0491-97aa-48c8-b361-353f5ecc7a0f@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Myriachan <myriachan@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: First draft of [[unreachable]] attribute proposal
Date: Mon, 13 Mar 2017 13:28:28 -0700 (PDT)
Lines: 116
Approved: news@gmane.org
Message-ID: <51fa0491-97aa-48c8-b361-353f5ecc7a0f@isocpp.org>
References: <e6a951ab-a7eb-4bce-86fd-6988215e2309@isocpp.org>
 <74928e4c-8f1e-4036-93d8-2560c27b651d@isocpp.org>
 <cc73faa8-2e33-4314-b50b-cf715b4e7ccf@isocpp.org>
 <f6b40768-7dbc-4019-b90b-f5c4398f0e25@isocpp.org>
 <996e889d-5922-4e13-84dd-d914ec44f5a4@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_9466_2146887185.1489436908096"
X-Trace: blaine.gmane.org 1489436918 30996 195.159.176.226 (13 Mar 2017 20:28:38 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 13 Mar 2017 20:28:38 +0000 (UTC)
Cc: dan@soundradix.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDKLT4PURQHRB3EBTTDAKGQEXWTXMQI@isocpp.org Mon Mar 13 21:28:27 2017
Return-path: <std-proposals+bncBDKLT4PURQHRB3EBTTDAKGQEXWTXMQI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f200.google.com ([209.85.161.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDKLT4PURQHRB3EBTTDAKGQEXWTXMQI@isocpp.org>)
	id 1cnWZr-0006fO-W0
	for gclcip-std-proposals@m.gmane.org; Mon, 13 Mar 2017 21:28:24 +0100
Original-Received: by mail-yw0-f200.google.com with SMTP id k13sf353243088ywk.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 13 Mar 2017 13:28:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=ffIAWAq7lL1PlISkc6BCs+N3sgLheGv2diJcku/c2gM=;
        b=njUM4T+UhMufmGacDTt6/2nvcHrPIc+6+dYh98E5sKLZgQ1LszFKxkWG+1MWjDRIr/
         oJwW6CuhFz4AgDwmqsfqxwfZZjoYilSswM5SNny5BPSHiOFuOTJylI1hZCHywLI4gwqu
         k0hAn74bOcsVyOHJmH7SmJ3YOIX+TCGG3shN/8JD9BJvwojAh6hRtc6wxaDnjR5QTsOJ
         zPgtDyACPhLy4TuoC06NQjuSE59KzOOr9rt+8ivtLljNw7OJYcvZjg/8LL8RN2TNEgHJ
         NUbE3reOis2afWcFk+70Pw+uFcE/14mn5ErLoY150FmLUT1/JiphforaK39TlNibQ8X9
         s/6A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=ffIAWAq7lL1PlISkc6BCs+N3sgLheGv2diJcku/c2gM=;
        b=oL8NX37U/Aw2JhqnCmaLrq3dbE6+/nNoFo+7He3N9brQ90pIrA/4YA5YQYQhEhfwJ7
         bFORogMpiVuh68FUd8iuvWrmgJFjUNGfrO/13oV+yVBdfcPpQ2qlnIUGWmLia0fLoqjy
         ZNx9s0Te2QjhZ6J2axxJhI8BmX/8I+mkxoBs5Fy9/HVAZ/9s7xPB00wwcOI39oYWuUlB
         tthnpsuBbvAxvuqV+7jSNMJOy1CyW8UxuSg/FsotvxPOiUi6V90pQo8JcMxHCktUsrqp
         RS/dtjoiJgwRbz/edHuo4UOTAZRI3wsL+d0JRMk0gG6nqAoCydaL3jsFQgcJm1Ff8W6C
         I98A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=ffIAWAq7lL1PlISkc6BCs+N3sgLheGv2diJcku/c2gM=;
        b=DuN3JDLJZi2V7U0zH0hkKKed9E+IQkUNaV4w2nKAYU/j/ETa6ERS9lweUV4cKCu0n/
         0wEbTsXRPXyrtV8t/YEQ1H1U3936KjtZI+7PzKAycU707Qr2r86UfwDPsYAbf53E2xfF
         YB85sOfN8zknpbiPAkrfTzqN8nZuUQ0lKXW7qbzs4VMqP3A1f9+F25hUbqc+ZaXX0ehP
         /mH83Q2og4R899U/yE8Nqs1Lmi5py0LQSlx1M9XC2d/tiw4Xn54bwVpd2iFpO6kVTJhC
         mh7htCpf3ZqaoevEQnEz6GxoYH6r7f0Y+OTvkmCcPuSkHaPDJfp6KXyNVHGYJnLgulLv
         t6bA==
X-Gm-Message-State: AMke39khYRPeaLxhoujaG1KoCmG9F/juQ0NaTt7tkC+7b6yFwRWG4KyPvujmjmhENMJdzw==
X-Received: by 10.13.248.198 with SMTP id i189mr18301481ywf.156.1489436909713;
        Mon, 13 Mar 2017 13:28:29 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.43.103 with SMTP id f36ls3516861otd.0.gmail; Mon, 13 Mar
 2017 13:28:28 -0700 (PDT)
X-Received: by 10.157.82.47 with SMTP id e47mr3241847oth.18.1489436908794;
        Mon, 13 Mar 2017 13:28:28 -0700 (PDT)
In-Reply-To: <996e889d-5922-4e13-84dd-d914ec44f5a4@isocpp.org>
X-Original-Sender: myriachan@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:31576
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31576>

------=_Part_9466_2146887185.1489436908096
Content-Type: multipart/alternative; 
	boundary="----=_Part_9467_961850427.1489436908096"

------=_Part_9467_961850427.1489436908096
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Sunday, March 12, 2017 at 6:19:15 AM UTC-7, d...@soundradix.com wrote:
>
> I think the opposite is correct WRT tooling; if you have a separate=20
> [[unreachable]] attribute, not only does it convey the intention better t=
o=20
> the reader, but it also does to any tool which sees the attribute, so for=
=20
> example a static analyzer can show exactly the path in which=20
> [[unreachable]] code becomes reachable, but not necessarily show it for=
=20
> failing [[assert]] attributes.
>
> On Saturday, March 11, 2017 at 4:24:35 PM UTC+2, Andrzej Krzemie=C5=84ski=
 wrote:
>>
>>
>> Given that the expression in the assertion is a compile-time constant=20
>> only [[assert: false]] is fine. But the interaction goes beyond only=20
>> syntax. If we have attribute [[unreachable]] maybe we want it to behave=
=20
>> like [[assert: false]] in every detail; that is: allow calling contract=
=20
>> violation handlers in test builds, if this place in the code is reached.=
=20
>> This way the hint can be used not only for optimization, but also for=20
>> instrumentation.
>>
>>

 I noticed that the draft of contractual programming does not say that=20
behavior is undefined if the expression is false past an [[assert axiom]]. =
=20
I asked co-author Professor J. Daniel Garcia about why the Standardese=20
didn't say that the behavior is undefined, and his reply was:

Because that is not necessarily true. It is just that the assertion is not=
=20
> checked.


This to me gives [[unreachable]] a niche of its own, rather than merely=20
being a simpler subset of another proposal.

Melissa

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/51fa0491-97aa-48c8-b361-353f5ecc7a0f%40isocpp.or=
g.

------=_Part_9467_961850427.1489436908096
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sunday, March 12, 2017 at 6:19:15 AM UTC-7, d...@soundr=
adix.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr=
">I think the opposite is correct WRT tooling; if you have a separate [[unr=
eachable]] attribute, not only does it convey the intention better to the r=
eader, but it also does to any tool which sees the attribute, so for exampl=
e a static analyzer can show exactly the path in which [[unreachable]] code=
 becomes reachable, but not necessarily show it for failing [[assert]] attr=
ibutes.<br><div><div><br>On Saturday, March 11, 2017 at 4:24:35 PM UTC+2, A=
ndrzej Krzemie=C5=84ski wrote:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
dir=3D"ltr"><br><div>Given that the expression in the assertion is a compil=
e-time constant only [[assert: false]] is fine. But the interaction goes be=
yond only syntax. If we have attribute [[unreachable]] maybe we want it to =
behave like [[assert: false]] in every detail; that is: allow calling contr=
act violation handlers in test builds, if this place in the code is reached=
.. This way the hint can be used not only for optimization, but also for ins=
trumentation.<br><br></div></div></blockquote></div></div></div></blockquot=
e><div><br><br>=C2=A0I noticed that the draft of contractual programming do=
es not say that behavior is undefined if the expression is false past an [[=
assert axiom]].=C2=A0 I asked co-author Professor J. Daniel Garcia about wh=
y the Standardese didn&#39;t say that the behavior is undefined, and his re=
ply was:<br><br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px =
0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">B=
ecause that is not necessarily true. It is just that the assertion is not c=
hecked.</blockquote><div><br>This to me gives [[unreachable]] a niche of it=
s own, rather than merely being a simpler subset of another proposal.<br><b=
r>Melissa<br></div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/51fa0491-97aa-48c8-b361-353f5ecc7a0f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/51fa0491-97aa-48c8-b361-353f5ecc7a0f=
%40isocpp.org</a>.<br />

------=_Part_9467_961850427.1489436908096--

------=_Part_9466_2146887185.1489436908096--

.
