220 36404 <b46ccd49-43c8-424e-90c9-3053128f6560@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: The current attribute/keyword dividing line is unsustainable.
Date: Wed, 27 Dec 2017 14:37:31 -0800 (PST)
Lines: 228
Approved: news@gmane.org
Message-ID: <b46ccd49-43c8-424e-90c9-3053128f6560@isocpp.org>
References: <86919454-9af9-4b08-b7b3-fd262b46cdd5@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_17782_1456175466.1514414251976"
X-Trace: blaine.gmane.org 1514414137 4569 195.159.176.226 (27 Dec 2017 22:35:37 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 27 Dec 2017 22:35:37 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDLZJYWNDQIKZQMQ2ICRUBEM4QJNO@isocpp.org Wed Dec 27 23:35:33 2017
Return-path: <std-proposals+bncBDLZJYWNDQIKZQMQ2ICRUBEM4QJNO@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f71.google.com ([209.85.213.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDLZJYWNDQIKZQMQ2ICRUBEM4QJNO@isocpp.org>)
	id 1eUKIN-0000ow-KK
	for gclcip-std-proposals@m.gmane.org; Wed, 27 Dec 2017 23:35:31 +0100
Original-Received: by mail-vk0-f71.google.com with SMTP id c67sf2380816vkf.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 27 Dec 2017 14:37:34 -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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=BWnAoAEDAe1m/zJTXOyoMGYlnIH2rdW56jLSKWeX0+s=;
        b=HI2eBvc4PG+izHaVWQkO0F9N0TxjBmcL9Sh5NZ0Azv9NJ/GnaSSEetJmLKM7y8jL/i
         T903++ySqhJRET7nWjOMEYGs8ZinKMyqN93fkRPwuT3fdAETxUZapcdtZa8c5lCuenjk
         fhrA+3q3If2XyY/RF5NlIGHchWCNd1AmC1AjUgSLS27AK5zx+II4KyWDZ4uiO6eB0Q82
         YM7uDhQgZ7Pnnnad2BG9VK9/+OK6jMnnVrIJdoYIRZ/Pyv7aqzQQmQOhoH7+rOZOxQwW
         9XX9t849ynhUYb0Y1iCDtyPTHCO5L+LehA69u0YA970djOFq0zXhiJMraAK7OwfX1ZoN
         PB9A==
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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=BWnAoAEDAe1m/zJTXOyoMGYlnIH2rdW56jLSKWeX0+s=;
        b=B81EGohwn4Ionl3nqTikvZi+/mM4txJn9yjz5U571VMy1MAfMU4TxpFYJD8VNB/Sqa
         HJMUd9f2T7cRRTyGwOq+d9s5hxSoLs5EUnFQaAk0if29F+axzjX5MmLW/g1m9cBDWpdu
         sEBmi+8OG/glow+INUql0bk7LYPG5/BPGwMeKAlRFUEMX1UWNiFVM0/rf0Q1JKTVtRNf
         NPyjWwqjY4GRYwddh1Iy5jjV3/TanM0m49kFlg0oBLvgtruBboRerhAcB9luzKLL3moJ
         4GPeijgC4d9nlOpU9O2ak2pGVhhV9QTcBUGl5UsKZ3felZo2gDQCXJiPtXg0WQmgbfgY
         tsdg==
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=BWnAoAEDAe1m/zJTXOyoMGYlnIH2rdW56jLSKWeX0+s=;
        b=FlVz57HrZyLC2Ws+tL/zL/VD+hebtgzz2rI02tQIedA7vikYWjLZa4emdlMORC+yIO
         ngtXHYOhofgTLjGMehyOw+fPS3RNztvm/L5/qXDcMyOQ6zk+i6LZPDM6tJ537yypEygO
         6Dxv1DDSn9yb65qSrLcCoPjVwK07d6h6xcA8+PPlERejiFDulDIX80tlURp7lHFsQTA+
         jAZBDolxE5KlptymgtQq6202YfQEL7zx0ab7jzMho8Fp3i2LRY5ZD0I4e0aBKcVHgV3+
         XN2l1xqvsdf5tCZsXb0FoYyv2hzlXwbe629xGMM3J654HYWwMTSQ2oFpLeiYIdQkCPHl
         X/iQ==
X-Gm-Message-State: AKGB3mLupcqYj7R+B77FdyFibdO7NLbhVFkTPrQCh8ZFvFEWMnockoed
	9lb0kQcdZAXaYp2usbIEQbBlgQ==
X-Google-Smtp-Source: ACJfBoukFIaBwS89uvpbEy6tjGyvUq0VTSb8poJqTM4lgA1nacR/G/SeSA0zoVCCeRKA3Ysu4UZZYg==
X-Received: by 10.176.95.101 with SMTP id z37mr9570177uah.26.1514414254162;
        Wed, 27 Dec 2017 14:37:34 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.176.1.3 with SMTP id 3ls4424683uak.9.gmail; Wed, 27 Dec 2017
 14:37:32 -0800 (PST)
X-Received: by 10.31.165.202 with SMTP id o193mr2743766vke.9.1514414252424;
        Wed, 27 Dec 2017 14:37:32 -0800 (PST)
In-Reply-To: <86919454-9af9-4b08-b7b3-fd262b46cdd5@isocpp.org>
X-Original-Sender: arthur.j.odwyer@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:36404
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36404>

------=_Part_17782_1456175466.1514414251976
Content-Type: multipart/alternative; 
	boundary="----=_Part_17783_967905290.1514414251976"

------=_Part_17783_967905290.1514414251976
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wednesday, December 27, 2017 at 10:15:35 AM UTC-8, Nicol Bolas wrote:
>
> There is clearly intended to be a dividing line between C++ attributes an=
d=20
> C++ keywords.
>
> Herb Sutter outlined one version of this division=20
> <https://herbsutter.com/2012/04/02/reader-qa-keywords-and-attributes/>.=
=20
> As he states:
>
> > [[attributes]] are specifically designed to be ignorable and shouldn=E2=
=80=99t=20
> be used for things having language semantic meaning.
>
> P0840=20
> <http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2017/p0840r0.html>=20
> offers a different but similar division:
>
> > compiling a valid program with all instances of a particular attribute=
=20
> ignored must result in a correct interpretation of the original program
>
> I submit that these dividing lines are both unsustainable and *have=20
> already been violated*.
>

I submit that the current situation is fine. We have guidelines, and we=20
have smart people in charge of making sure that reality follows those=20
guidelines as closely as possible (but no closer).

The original source of the "Attributes should not change semantics"=20
guideline was N2761 "Towards support for attributes in C++ (R6)", in 2008.=
=20
Here is the complete text of the guidelines at the time, with hyperlinks to=
=20
various original documents, which I collated the last time this topic came=
=20
up.
https://groups.google.com/a/isocpp.org/d/msg/sg14/IvKFg6-9_Xo/PNj1kAntCQAJ
IMO, these guidelines have held up very well.  They are still quite=20
sensible.  I don't think N2761 has any embarrassing conflicts with the=20
actual history of C++ since 2008.


What makes this unsustainable is this: what we eventually want to do is=20
> make [[fallthrough]]* mandatory*. That is, to make it ill-formed to fall=
=20
> through without explicitly asking for it. The problem is that we can't. S=
o=20
> long as we stick to the above rules about attributes, we cannot have the=
=20
> standard declare the lack of use of an attribute to be ill-formed.
>

I think you're mixing senses of the word "we".  *Individual programmers*=20
may want to make [[fallthrough]] mandatory or may not, depending on their=
=20
degree of paranoia and/or degree of spending time maintaining C code from=
=20
the 1980s.  *Individual vendors* are effectively free to make=20
[[fallthrough]] mandatory today (and have generally already done so, in the=
=20
recommended -W -Wall -Werror mode of invocation).  *The ISO C++ Committee*=
=20
indeed cannot declare the lack of use of an attribute to be ill-formed, as=
=20
long as the ISO C++ Committee sticks (strictly) to the above guidelines;=20
but fortunately, I don't think the ISO C++ Committee has much interest in=
=20
sticking strictly to any guideline ever.  Heck, they don't even stick to=20
the *official ISO language standard* for more than three years at a time=20
anymore. ;)


Something similar happens with [[noreturn]]: if we ever want to make=20
> functions that fail to return ill-formed, we would have to make such a ru=
le=20
> take into account calls to [[noreturn]] functions. But we can't do that,=
=20
> because attributes cannot be used to make something ill-formed.
>

As observed in many a previous thread: sure they can. Look at=20
[dcl.attr.fallthrough]/1, specifically the sentence beginning "The program=
=20
is ill-formed if..."
The Committee follows its self-imposed guidelines *as closely as possible,=
=20
but no closer*.

[...]

> But we should not separate out attributes from keywords in terms of their=
=20
> relation to overall program behavior. That is, we should ditch the idea=
=20
> that attributes should be considered "ignorable", that the lack of an=20
> attribute should never cause a program to be ill-formed.
>

I have good news for you. ;)

=E2=80=93Arthur

--=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/b46ccd49-43c8-424e-90c9-3053128f6560%40isocpp.or=
g.

------=_Part_17783_967905290.1514414251976
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, December 27, 2017 at 10:15:35 AM UTC-8, Nico=
l Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
><div>There is clearly intended to be a dividing line between C++ attribute=
s and C++ keywords.</div><div><br></div><div>Herb Sutter <a href=3D"https:/=
/herbsutter.com/2012/04/02/reader-qa-keywords-and-attributes/" target=3D"_b=
lank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google.c=
om/url?q\x3dhttps%3A%2F%2Fherbsutter.com%2F2012%2F04%2F02%2Freader-qa-keywo=
rds-and-attributes%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGbFG4_kMN2lB4=
sho01UUyGR606Yg&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.=
google.com/url?q\x3dhttps%3A%2F%2Fherbsutter.com%2F2012%2F04%2F02%2Freader-=
qa-keywords-and-attributes%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGbFG4=
_kMN2lB4sho01UUyGR606Yg&#39;;return true;">outlined one version of this div=
ision</a>. As he states:</div><div><br></div><div>&gt;=C2=A0[[attributes]] =
are specifically designed to be ignorable and shouldn=E2=80=99t be used for=
 things having language semantic meaning.</div><div><br></div><div><a href=
=3D"http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2017/p0840r0.html" t=
arget=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://ww=
w.google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2FJTC1%2FSC22%2FWG21%2F=
docs%2Fpapers%2F2017%2Fp0840r0.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjC=
NErg6DrPIy-NrUzpoBnQvvMw_DJfg&#39;;return true;" onclick=3D"this.href=3D&#3=
9;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2FJTC1%2FSC2=
2%2FWG21%2Fdocs%2Fpapers%2F2017%2Fp0840r0.html\x26sa\x3dD\x26sntz\x3d1\x26u=
sg\x3dAFQjCNErg6DrPIy-NrUzpoBnQvvMw_DJfg&#39;;return true;">P0840</a> offer=
s a different but similar division:</div><div><br></div><div>&gt;=C2=A0comp=
iling a valid program with all instances of a particular attribute ignored
must result in a correct interpretation of the original program</div><div><=
br></div><div>I submit that these dividing lines are both unsustainable and=
 <i>have already been violated</i>.</div></div></blockquote><div><br></div>=
<div>I submit that the current situation is fine. We have guidelines, and w=
e have smart people in charge of making sure that reality follows those gui=
delines as closely as possible (but no closer).</div><div><br></div><div>Th=
e original source of the &quot;Attributes should not change semantics&quot;=
 guideline was N2761 &quot;Towards support for attributes in C++ (R6)&quot;=
, in 2008. Here is the complete text of the guidelines at the time, with hy=
perlinks to various original documents, which I collated the last time this=
 topic came up.</div><div><a href=3D"https://groups.google.com/a/isocpp.org=
/d/msg/sg14/IvKFg6-9_Xo/PNj1kAntCQAJ">https://groups.google.com/a/isocpp.or=
g/d/msg/sg14/IvKFg6-9_Xo/PNj1kAntCQAJ</a><br></div><div>IMO, these guidelin=
es have held up very well. =C2=A0They are still quite sensible. =C2=A0I don=
&#39;t think N2761 has any embarrassing conflicts with the actual history o=
f C++ since 2008.</div><div><br></div><div><br></div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr"><div>What makes this unsustainable =
is this: what we eventually want to do is make [[fallthrough]]<i> mandatory=
</i>. That is, to make it ill-formed to fall through without explicitly ask=
ing for it. The problem is that we can&#39;t. So long as we stick to the ab=
ove rules about attributes, we cannot have the standard declare the lack of=
 use of an attribute to be ill-formed.<br></div></div></blockquote><div><br=
></div><div>I think you&#39;re mixing senses of the word &quot;we&quot;.=C2=
=A0=C2=A0<b>Individual programmers</b> may want to make [[fallthrough]] man=
datory or may not, depending on their degree of paranoia and/or degree of s=
pending time maintaining C code from the 1980s.=C2=A0=C2=A0<b>Individual ve=
ndors</b>=C2=A0are effectively free to make [[fallthrough]] mandatory today=
 (and have generally already done so, in the recommended -W -Wall -Werror m=
ode of invocation). =C2=A0<b>The ISO C++ Committee</b> indeed cannot declar=
e the lack of use of an attribute to be ill-formed, as long as the ISO C++ =
Committee sticks (strictly) to the above guidelines; but fortunately, I don=
&#39;t think the ISO C++ Committee has much interest in sticking strictly t=
o any guideline ever. =C2=A0Heck, they don&#39;t even stick to the <i>offic=
ial ISO language standard</i> for more than three years at a time anymore. =
;)</div><div><br></div><div><br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left=
: 1ex;"><div dir=3D"ltr"><div></div><div>Something similar happens with [[n=
oreturn]]: if we ever want to make functions that fail to return ill-formed=
, we would have to make such a rule take into account calls to [[noreturn]]=
 functions. But we can&#39;t do that, because attributes cannot be used to =
make something ill-formed.</div></div></blockquote><div><br></div><div>As o=
bserved in many a previous thread: sure they can. Look at [dcl.attr.fallthr=
ough]/1, specifically the sentence beginning &quot;The program is ill-forme=
d if...&quot;</div><div>The Committee follows its self-imposed guidelines <=
i>as closely as possible, but no closer</i>.</div><div><br></div><div>[...]=
</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8=
ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Bu=
t we should not separate out attributes from keywords in terms of their rel=
ation to overall program behavior. That is, we should ditch the idea that a=
ttributes should be considered &quot;ignorable&quot;, that the lack of an a=
ttribute should never cause a program to be ill-formed.<br></div></div></bl=
ockquote><div><br></div><div>I have good news for you. ;)</div><div><br></d=
iv><div>=E2=80=93Arthur</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/b46ccd49-43c8-424e-90c9-3053128f6560%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b46ccd49-43c8-424e-90c9-3053128f6560=
%40isocpp.org</a>.<br />

------=_Part_17783_967905290.1514414251976--

------=_Part_17782_1456175466.1514414251976--

.
