220 31554 <f6b40768-7dbc-4019-b90b-f5c4398f0e25@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Andrzej_Krzemie=C5=84ski?= <akrzemi1@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: First draft of [[unreachable]] attribute proposal
Date: Sat, 11 Mar 2017 06:24:34 -0800 (PST)
Lines: 151
Approved: news@gmane.org
Message-ID: <f6b40768-7dbc-4019-b90b-f5c4398f0e25@isocpp.org>
References: <e6a951ab-a7eb-4bce-86fd-6988215e2309@isocpp.org>
 <74928e4c-8f1e-4036-93d8-2560c27b651d@isocpp.org>
 <cc73faa8-2e33-4314-b50b-cf715b4e7ccf@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2563_1377689398.1489242275045"
X-Trace: blaine.gmane.org 1489242279 23123 195.159.176.226 (11 Mar 2017 14:24:39 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 11 Mar 2017 14:24:39 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDT2DGOJ34DBBJERSDDAKGQESOEOEYA@isocpp.org Sat Mar 11 15:24:34 2017
Return-path: <std-proposals+bncBDT2DGOJ34DBBJERSDDAKGQESOEOEYA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f199.google.com ([209.85.192.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDT2DGOJ34DBBJERSDDAKGQESOEOEYA@isocpp.org>)
	id 1cmhwd-0005Ev-8E
	for gclcip-std-proposals@m.gmane.org; Sat, 11 Mar 2017 15:24:31 +0100
Original-Received: by mail-pf0-f199.google.com with SMTP id 67sf212550681pfg.0
        for <gclcip-std-proposals@m.gmane.org>; Sat, 11 Mar 2017 06:24:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=Oil4WgeIc7EF6GFlyAyQwILBJll7gtPyh6fatAhSSWw=;
        b=cj7rJOhY6LDgChQQ1uyjmehSVxT6zoJgupJ5B54ck2uuS7ndPZMLAXGGUX4h1iXk1j
         qZz3q9EgHyzzulzLHm9VPtkOQr+xBc3BDH47UqDV4Z465hO8bW/KYCmdkMRSnLd7f15f
         iqm7yrbR64bdmhNkX/fID2A1NC5RFH2CR5xPT4NLBEOBTjNRlJlnnv0bSOHN2J7PwJih
         FgMxQiHwRQtdO9pFwnpWXJoIMFoKrG23ecg5XQeY4qqoxDFc/bNaxkexaDUX3lXsI+I8
         BWXmV2OI3sWycvsCABZbb21fSGHrfQbh/CGeKKQlENxzQSX5Da988+BDMgMEca7gOH0v
         NuDg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to: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=Oil4WgeIc7EF6GFlyAyQwILBJll7gtPyh6fatAhSSWw=;
        b=P3zZ647ZtWuTqfTYOukwknCpsPIo7HQ1IkcSVyrs8hfmD6vzzkLASFvgIjD4zVYFL+
         n36VCfEIB0rByP7p5jKuIONQ9/GSwil+B7ILlAlQ+LQeAlayGYSNnZ61vTC8am4cro5c
         PH1dxN5qihnCM5BqQpVwIz8UqKCc9jSSpVaUzPqHoJwq4ECl1gr4MQ2xXX9jBImif3rs
         zI7LGfSKVNAwLrEpcuYwoaxF5DdUEVl9LFtW42a8nHahRpciHWtGhyontlxtfo/l0Hmr
         uQHvxGF1Vj/RzBPNhqMr4D6Imsr1wa6Ky5SRSf9brQi3acNnph3BrZa802oeIga5mwG0
         4csQ==
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: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=Oil4WgeIc7EF6GFlyAyQwILBJll7gtPyh6fatAhSSWw=;
        b=ih8jjBYP3OnL/dA8grsKNsDKS2OnQlwyPCw23M5mgI9H8cBV5GrQj25V+i0QgdDHXC
         2FYxGZKtEkaGfzIzGGm0r8EhFBH2f4lIRGENaetrW4aHssnQkJkBTJ/Zhtk4AMi75m7X
         ZPhYUsH3UL6+v86T9m9ZJHEKChFveMssVap+ntXNNE3PT9AuwvoaN4kvIyekhMBwld3m
         ay1tZke50KlXtNDV/cJ/DJNFy7cC6Qm94Z/L3sNeeAcpEz3ZFG/plb042b8Mmv0iUsRB
         ALR4KTn/tAhi4C6KrF32G5xLQsQXM+U+m2cvc/p7QbMig5HnRRs3EsGzkLyh91mI3Y+W
         Tiuw==
X-Gm-Message-State: AMke39mQWsFINUy3SUkUk+rZYq1eZfgRq7CZ1tGvbFKAvG3zDfIe5vwKxDHq74VGaN0yPg==
X-Received: by 10.99.114.20 with SMTP id n20mr11000907pgc.97.1489242276891;
        Sat, 11 Mar 2017 06:24:36 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.68.202 with SMTP id p10ls4845470otg.18.gmail; Sat, 11 Mar
 2017 06:24:35 -0800 (PST)
X-Received: by 10.157.80.16 with SMTP id a16mr2742411oth.3.1489242275960;
        Sat, 11 Mar 2017 06:24:35 -0800 (PST)
In-Reply-To: <cc73faa8-2e33-4314-b50b-cf715b4e7ccf@isocpp.org>
X-Original-Sender: akrzemi1@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:31554
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31554>

------=_Part_2563_1377689398.1489242275045
Content-Type: multipart/alternative; 
	boundary="----=_Part_2564_494395188.1489242275045"

------=_Part_2564_494395188.1489242275045
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



W dniu pi=C4=85tek, 10 marca 2017 13:41:05 UTC+1 u=C5=BCytkownik Morwenn na=
pisa=C5=82:
>
> Le vendredi 10 mars 2017 13:04:37 UTC+1, Andrzej Krzemie=C5=84ski a =C3=
=A9crit :
>>
>>
>>
>> W dniu czwartek, 9 marca 2017 04:49:35 UTC+1 u=C5=BCytkownik Myriachan n=
apisa=C5=82:
>>>
>>> I wrote up a proposal document for a new attribute, [[unreachable]],=20
>>> which lets you mark locations in code as being unreachable for optimiza=
tion=20
>>> purposes, or to suppress certain warnings.
>>>
>>> This has been discussed on the mailing list before; there's a link to=
=20
>>> that thread in the .pdf.
>>>
>>> https://1drv.ms/b/s!Agwy_QljRwlGgcoJeZMiimuq3H36Ww=20
>>> <https://www.google.com/url?q=3Dhttps%3A%2F%2F1drv.ms%2Fb%2Fs!Agwy_QljR=
wlGgcoJeZMiimuq3H36Ww&sa=3DD&sntz=3D1&usg=3DAFQjCNH4Mt71oANAe87AA1PY9Qf74w5=
yWQ>
>>>
>>> I have no idea what to do with it now.  If you have any comments on the=
=20
>>> content, or how to actually proceed, let me know! =3D^-^=3D
>>>
>>>
>>> Under the contract proposal, anywhere where the statement is expected,=
=20
>>> you can type:
>>>
>>> [[assert: false]];
>>>
>>> While [[assert axiom: false]] is probably semantically equivalent to=20
>>> the proposed [[unreachable]], the former doesn't really convey the=20
>>> meaning.
>>>
>>> I would be more confortable adding [[unreachable]] to the default=20
>>> branch of a switch than the equivalent [[assert axiom: false]].
>>>
>>
Given that the expression in the assertion is a compile-time constant only=
=20
[[assert: false]] is fine. But the interaction goes beyond only syntax. If=
=20
we have attribute [[unreachable]] maybe we want it to behave like [[assert:=
=20
false]] in every detail; that is: allow calling contract violation handlers=
=20
in test builds, if this place in the code is reached. This way the hint can=
=20
be used not only for optimization, but also for instrumentation.

Regards,
&rzej;

--=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/f6b40768-7dbc-4019-b90b-f5c4398f0e25%40isocpp.or=
g.

------=_Part_2564_494395188.1489242275045
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>W dniu pi=C4=85tek, 10 marca 2017 13:41:05 UTC+1 u=
=C5=BCytkownik Morwenn napisa=C5=82:<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">Le vendredi 10 mars 2017 13:04:37 UTC+1, Andrzej Krz=
emie=C5=84ski a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D=
"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr"><br><br>W dniu czwartek, 9 marca 2017 04:49:35 UTC+1 u=C5=BC=
ytkownik Myriachan napisa=C5=82:<blockquote class=3D"gmail_quote" style=3D"=
margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v>I wrote up a proposal document for a new attribute, [[unreachable]], whic=
h lets you mark locations in code as being unreachable for optimization pur=
poses, or to suppress certain warnings.<br><br>This has been discussed on t=
he mailing list before; there&#39;s a link to that thread in the .pdf.<br><=
br><a href=3D"https://www.google.com/url?q=3Dhttps%3A%2F%2F1drv.ms%2Fb%2Fs!=
Agwy_QljRwlGgcoJeZMiimuq3H36Ww&amp;sa=3DD&amp;sntz=3D1&amp;usg=3DAFQjCNH4Mt=
71oANAe87AA1PY9Qf74w5yWQ" rel=3D"nofollow" target=3D"_blank" onmousedown=3D=
"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2F1drv.ms%2Fb=
%2Fs!Agwy_QljRwlGgcoJeZMiimuq3H36Ww\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjC=
NH4Mt71oANAe87AA1PY9Qf74w5yWQ&#39;;return true;" onclick=3D"this.href=3D&#3=
9;https://www.google.com/url?q\x3dhttps%3A%2F%2F1drv.ms%2Fb%2Fs!Agwy_QljRwl=
GgcoJeZMiimuq3H36Ww\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH4Mt71oANAe87AA=
1PY9Qf74w5yWQ&#39;;return true;">https://1drv.ms/b/s!Agwy_<wbr>QljRwlGgcoJe=
ZMiimuq3H36Ww</a><br><br>I have no idea what to do with it now.=C2=A0 If yo=
u have any comments on the content, or how to actually proceed, let me know=
! =3D^-^=3D<br><br><br>Under the contract proposal, anywhere where the stat=
ement is expected, you can type:<br><br><div style=3D"background-color:rgb(=
250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:=
1px"><code><div><span style=3D"color:#660">[[</span><span style=3D"color:#0=
08">assert</span><span style=3D"color:#660">:</span><span style=3D"color:#0=
00"> </span><span style=3D"color:#008">false</span><span style=3D"color:#66=
0">]];</span></div></code></div><br>While <span style=3D"font-family:courie=
r new,monospace">[[assert axiom: false]]</span> is probably semantically eq=
uivalent to the proposed <span style=3D"font-family:courier new,monospace">=
[[unreachable]]</span>, the former doesn&#39;t really convey the meaning.<b=
r><br>I would be more confortable adding <span style=3D"font-family:courier=
 new,monospace">[[unreachable]]</span> to the <span style=3D"font-family:co=
urier new,monospace">default</span> branch of a <span style=3D"font-family:=
courier new,monospace">switch</span> than the equivalent <span style=3D"fon=
t-family:courier new,monospace">[[assert axiom: false]]<font face=3D"arial,=
sans-serif">.</font></span></div></blockquote></div></blockquote></div></bl=
ockquote><div><br>Given that the expression in the assertion is a compile-t=
ime constant only [[assert: false]] is fine. But the interaction goes beyon=
d only syntax. If we have attribute [[unreachable]] maybe we want it to beh=
ave like [[assert: false]] in every detail; that is: allow calling contract=
 violation handlers in test builds, if this place in the code is reached. T=
his way the hint can be used not only for optimization, but also for instru=
mentation.<br><br>Regards,<br>&amp;rzej;<br></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/f6b40768-7dbc-4019-b90b-f5c4398f0e25%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f6b40768-7dbc-4019-b90b-f5c4398f0e25=
%40isocpp.org</a>.<br />

------=_Part_2564_494395188.1489242275045--

------=_Part_2563_1377689398.1489242275045--

.
