220 40244 <CAFdMc-1tpJj3bSzHgD=pxWD2eVokRX3ST2QE-oF6M8z1=DTEoQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Daniel Gutson <danielgutson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: more security concerns
Date: Fri, 28 Sep 2018 11:17:56 -0300
Lines: 274
Approved: news@gmane.org
Message-ID: <CAFdMc-1tpJj3bSzHgD=pxWD2eVokRX3ST2QE-oF6M8z1=DTEoQ@mail.gmail.com>
References: <CAFdMc-0NqfbqeOhhH1YiVGxDRVPv7COKNqge3mLu8UE8SgcXNw@mail.gmail.com>
 <CAO8_tC4kNZ6s-xMXo69n1D3dbOMkqt0fjLU44Uq5TfABp17hQQ@mail.gmail.com>
 <CAFdMc-1DpAUkYDVyNmP5H49XyNVDq5_T6UkEVaQGMGA0YEhNGw@mail.gmail.com> <94d79dd7-ba3b-4bf8-91ed-e5dc02b33670@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="000000000000ffc75a0576ef1f3f"
X-Trace: blaine.gmane.org 1538144166 19285 195.159.176.226 (28 Sep 2018 14:16:06 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 28 Sep 2018 14:16:06 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDE3NBMV6UFBBI7QXDOQKGQEXASPTDY@isocpp.org Fri Sep 28 16:16:02 2018
Return-path: <std-proposals+bncBDE3NBMV6UFBBI7QXDOQKGQEXASPTDY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lj1-f200.google.com ([209.85.208.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDE3NBMV6UFBBI7QXDOQKGQEXASPTDY@isocpp.org>)
	id 1g5tYn-0004tH-2x
	for gclcip-std-proposals@m.gmane.org; Fri, 28 Sep 2018 16:16:01 +0200
Original-Received: by mail-lj1-f200.google.com with SMTP id i2-v6sf1809831ljb.9
        for <gclcip-std-proposals@m.gmane.org>; Fri, 28 Sep 2018 07:18:12 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1538144291; cv=pass;
        d=google.com; s=arc-20160816;
        b=tQUPCHHSlbFjnT7UJ2PWn2Nu1NGTWSMLzIPvc1dQoK7uzBHtI0yRd3cxc8miZ6bskZ
         kFy90sLC17Eywlv+nJ4Go5ZRQ/oBxMht3TwBc36y0hFjgoHJN6eJ5of4S9TWctn1EZkL
         6WBBhXZOC142AnUkAwuPh8IN0dnIrsvaMWv9KrR+Fe23+bN8l/XEXEAgcMzGD8KaeLpb
         FfeNwO2xiaY3mwhLGb+hiXWuZ8xoXUJlkJFBulT4jKMRM4ZxKDQv/RyOXA7ZnJg70y2m
         3JjzwVLCUl5jGUPxd+8cIql/J5lsuKsxAsERKrlapEdNEzUoR0Oyi4574vL0n05xEicE
         sMkg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:dkim-signature;
        bh=RuQvSsoMGkWh5QrFKmmnCIhWgnyPXUkdtJE4kSv/c/g=;
        b=1LQillDd63a7xxEJWEzYhWe8vV5GzGYs1Yi5+L5K7TqWeqwaCcsJ27FkQ8RUJS8UfQ
         rfHipycWUK3d3869zvz/cVguxxYChLmpt87RRdXJu9m6ZzGQflY1mHUOAfQrlHwRXgEJ
         zDf9u19MLXgDxpgPKCO8wLD8dvL7v800GQQ+3WxON6V/uZDSjUJ22BpYwlOmWXe2cFrU
         TvCjS450Qbq+E9stUqrzHGV2xLK1dygkPQ5gol7g4v2PUY7ojPSU1R3xyd8f4nzsswio
         AJUbrjFsB7+Sxewj9RzMNtw/8SItQfttzXNJgjV0sGsydFJhkpb4G7H4kTgn99o7wbek
         gwng==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zle45bT2;
       spf=pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=danielgutson@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=RuQvSsoMGkWh5QrFKmmnCIhWgnyPXUkdtJE4kSv/c/g=;
        b=Tjk3jQqL0vWxSqNKBiegrr/RoZBiNuviHvHaS/yTgHEcwQ/uIedLLqwVke5DrEgJml
         /s88zWYS+4cG/IRW1dW+hzcNysEfw2NW0p/9Fme7I8eA0rXsIc9zhQNNp5yf8DHla3Ty
         UmLcSjedFGj6VXumM8phhoseETDCVX6vyAbtdtQZbGfxqKsJy/UVOH2T2mHzKzQMLJ78
         LlnPGpOH0UzEsXbYZ6Ac7z+WZDzM1pFpxLiGxXfy2w+b714vzxKCjO+xzAjF15grePP0
         NQdi9LO+HY/s8nCrZyz1B8AuqIJ1csuGbiXICqpl11OsXX1VbFzUThdlmWQCmd6Y13to
         9m3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=RuQvSsoMGkWh5QrFKmmnCIhWgnyPXUkdtJE4kSv/c/g=;
        b=QgUCilYrPk11UTv65oKKtToeoLwaTJrfZqqqXK/G73CZha6jCISB1vVdtroSGdx7hg
         Q0mlZoe+Dcj2DH4av8+EvDSk2Q4/Jn6qXwYAWsiMk9lwdBR5IKcwbnH3yad4jgjKnZZ1
         yRd2cLxVbSnLBQEZrNEo+m4ztrNkz5R0S3isqxIl3CXdptMIoj+41T/UGLx1C67rymmg
         fSxHzy5w2oTFrQcTC7223LMVH1A5OJqloSTw4nfQQUTn8p+dWqbtw+YfeB42bFvyrxLe
         ZQfOHdKw3HUfEN4naVJbe81rWpeiUPY273x5MsOfHc7jKI1W7GeKqqD/D2uAouffYxfS
         VlKw==
X-Gm-Message-State: ABuFfojMeaOi59u+EIHmxSQ5iBCRwjixlI6/8VAwvS8E7FKIQkpvl/NS
	YBPDYJyg3buBFA8w5+4YRtUT5w==
X-Google-Smtp-Source: ACcGV60cIb1g9qzIF1J0FtmHrOAgUH1dwR2JShij2wAFlcp19EWotKGoAq6biqnjrKd9BUOk8MEBLw==
X-Received: by 2002:a19:1628:: with SMTP id m40-v6mr482261lfi.10.1538144291839;
        Fri, 28 Sep 2018 07:18:11 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a2e:9ed1:: with SMTP id h17-v6ls1049826ljk.12.gmail; Fri, 28
 Sep 2018 07:18:10 -0700 (PDT)
X-Received: by 2002:a2e:8457:: with SMTP id u23-v6mr3487533ljh.154.1538144290658;
        Fri, 28 Sep 2018 07:18:10 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1538144290; cv=none;
        d=google.com; s=arc-20160816;
        b=yHWrN3pNMz/JS1sKE3NsqY8D6kYl6/5yL6XqCiYcl9DORYieGuo5yN7UgVAY/GNGCl
         A7vFfpbqe62ooWEzYhyioxbL9Z+OW2bnUEpJjQHLra31pWErBHdiHQ7TVhLeTRH6Osey
         /KoNribPoA7zZMqHvNrIuqbPCHDZYcrEPi0gMLQvt+rf1g+bdv5QDgnIppjI97XQ6XZY
         YbnFNjicK3vuOmy42aRFpUbXzHW/j/5LWHqYLD5DfuVxsGeMjACqvcrezLgVv5DLwMcD
         Kgx7BnG1VxmrPiRwkMZrXo9IBhyVnXajHy1NWrGK96EreY9l2kjOWsrCzrJmWZyq7tUI
         OZCA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=v8WBrXHrfD8zmS9xZycbZRPDukrIzOTy+TPUcpo+pys=;
        b=nRouPeflblfxWVOntMPeWCqZyLn0s3WnrTaOscqkcTcLX2iqPV4AoKPgeHaRxV4C6I
         JD5cQeUVys8N33xHfB4zYUAx0RHoaOQAwwAYBaoKlRaC4M4EsUdl7D3KwD9abhPm3cVa
         mPl+53Q/eHG4nObQjoWdCDyXEymsShYenj0C0RpmEjB844j5Lt8gYQS6QzUv05eeOvHd
         eW9+jY2QQ/gy+p+KaIEWOed3lVFeyuKZa0o0whfRYsh6AsqoyCpSJDedOcx2TyKWBrlF
         QGb2jxyBDFzGIHOHpDNo23GbXK+uiG26ayvMGoT7jDhTGJqTTOYghVMsEiW4+YNWXq3t
         g98Q==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zle45bT2;
       spf=pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=danielgutson@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id h3-v6sor3318506ljg.13.2018.09.28.07.18.10
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Fri, 28 Sep 2018 07:18:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a2e:9a93:: with SMTP id p19-v6mr9203lji.87.1538144289669;
 Fri, 28 Sep 2018 07:18:09 -0700 (PDT)
In-Reply-To: <94d79dd7-ba3b-4bf8-91ed-e5dc02b33670@isocpp.org>
X-Original-Sender: danielgutson@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=Zle45bT2;       spf=pass
 (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=danielgutson@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE dis=NONE) header.from=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:40244
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40244>

--000000000000ffc75a0576ef1f3f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

El vie., 28 sept. 2018 11:14, <florian.csdt@gmail.com> escribi=C3=B3:

> I want to highlight that [[nodiscard]] on functions is not about forcing
> the compiler to keep the value, but instead to emit a warning if the user
> doesn't use the value.
>

I'm proposing using [[nodiscard]] for statements rather than for
declarations.
That being said, it would be placed in the function call statement. I want
the compiler to still do DSE where appropriate and at the same time allow
the programmer to thoughtfully prevent it.


So meaning would be different.
> In that respect, another attribute name might be better.
>
> Also, it is already possible (but cumbersome) to implement already withou=
t
> volatile:
> void f() {
>   int secret_int;
>   float secret_float;
>   /* ... */
>   secret_int =3D 0;
>   secret_float =3D 0
>   asm volatile ("" ::"irm"(secret_int), "xm"(secret_float));
> }
>
> I would really like an attribute for that, though.
>
>
> Le vendredi 28 septembre 2018 15:36:42 UTC+2, Daniel Gutson a =C3=A9crit =
:
>>
>> Yeah.  But please note that this is not only for function calls.
>>
>> void f()
>> {
>>    int secret;
>>    ....
>>    secret =3D 0;  //removed due to DSE
>> }
>>
>> If I declare secret as volatile or write 0s to its address I may prevent
>> the compiler to use a register impacting in performance. That's why I wa=
nt
>> to use the attribute here too.
>>
>>
>>
>> El vie., 28 sept. 2018 10:32, Andrew Giese <gies...@gmail.com> escribi=
=C3=B3:
>>
>>> I like the idea.
>>> Function poisoning might also serve your needs. E.g.,
>>> https://www.fluentcpp.com/2018/09/04/function-poisoning-in-cpp/
>>>
>>> If gcc poison were standardized in some fashion, you could write your
>>> own wrappers to those functions with all the [[nodiscard]] you might wa=
nt.
>>>
>>> Control in that case is a little less granular, indeed. Probably if
>>> you're writing [[nodiscard]] on a per-expression basis you are not
>>> discarding the result already.
>>>
>>> Regards
>>>
>>> --
>>> 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 email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAO8_tC4kN=
Z6s-xMXo69n1D3dbOMkqt0fjLU44Uq5TfABp17hQQ%40mail.gmail.com
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAO8_tC4k=
NZ6s-xMXo69n1D3dbOMkqt0fjLU44Uq5TfABp17hQQ%40mail.gmail.com?utm_medium=3Dem=
ail&utm_source=3Dfooter>
>>> .
>>>
>> --
> 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
> email 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/94d79dd7-ba3=
b-4bf8-91ed-e5dc02b33670%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/94d79dd7-ba=
3b-4bf8-91ed-e5dc02b33670%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>

--=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/CAFdMc-1tpJj3bSzHgD%3DpxWD2eVokRX3ST2QE-oF6M8z1%=
3DDTEoQ%40mail.gmail.com.

--000000000000ffc75a0576ef1f3f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">=
El vie., 28 sept. 2018 11:14,  &lt;<a href=3D"mailto:florian.csdt@gmail.com=
">florian.csdt@gmail.com</a>&gt; escribi=C3=B3:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr">I want to highlight that [[nodiscard]] on fu=
nctions is not about forcing the compiler to keep the value, but instead to=
 emit a warning if the user doesn&#39;t use the value.<br></div></blockquot=
e></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">I&#39;m proposi=
ng using [[nodiscard]] for statements rather than for declarations.</div><d=
iv dir=3D"auto">That being said, it would be placed in the function call st=
atement. I want the compiler to still do DSE where appropriate and at the s=
ame time allow the programmer to thoughtfully prevent it.</div><div dir=3D"=
auto"><br></div><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=3D=
"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">So meaning wo=
uld be different.<br>In that respect, another attribute name might be bette=
r.<br><br>Also, it is already possible (but cumbersome) to implement alread=
y without volatile:<br><div style=3D"background-color:rgb(250,250,250);bord=
er-color:rgb(187,187,187);border-style:solid;border-width:1px" class=3D"m_1=
356521278005008546prettyprint"><code class=3D"m_1356521278005008546prettypr=
int"><div class=3D"m_1356521278005008546subprettyprint"><span style=3D"colo=
r:#008" class=3D"m_1356521278005008546styled-by-prettify">void</span><span =
style=3D"color:#000" class=3D"m_1356521278005008546styled-by-prettify"> </s=
pan><span style=3D"color:#000" class=3D"m_1356521278005008546styled-by-pret=
tify">f</span><span style=3D"color:#660" class=3D"m_1356521278005008546styl=
ed-by-prettify">()</span><span style=3D"color:#000" class=3D"m_135652127800=
5008546styled-by-prettify"> </span><span style=3D"color:#660" class=3D"m_13=
56521278005008546styled-by-prettify">{</span><span style=3D"color:#000" cla=
ss=3D"m_1356521278005008546styled-by-prettify"><br>=C2=A0 </span><span styl=
e=3D"color:#008" class=3D"m_1356521278005008546styled-by-prettify">int</spa=
n><span style=3D"color:#000" class=3D"m_1356521278005008546styled-by-pretti=
fy"> secret_int</span><span style=3D"color:#660" class=3D"m_135652127800500=
8546styled-by-prettify">;</span><span style=3D"color:#000" class=3D"m_13565=
21278005008546styled-by-prettify"><br>=C2=A0 </span><span style=3D"color:#0=
08" class=3D"m_1356521278005008546styled-by-prettify">float</span><span sty=
le=3D"color:#000" class=3D"m_1356521278005008546styled-by-prettify"> secret=
_float</span><span style=3D"color:#660" class=3D"m_1356521278005008546style=
d-by-prettify">;</span><span style=3D"color:#000" class=3D"m_13565212780050=
08546styled-by-prettify"><br>=C2=A0 </span><span style=3D"color:#800" class=
=3D"m_1356521278005008546styled-by-prettify">/* ... */</span><span style=3D=
"color:#000" class=3D"m_1356521278005008546styled-by-prettify"><br>=C2=A0 s=
ecret_int </span><span style=3D"color:#660" class=3D"m_1356521278005008546s=
tyled-by-prettify">=3D</span><span style=3D"color:#000" class=3D"m_13565212=
78005008546styled-by-prettify"> </span><span style=3D"color:#066" class=3D"=
m_1356521278005008546styled-by-prettify">0</span><span style=3D"color:#660"=
 class=3D"m_1356521278005008546styled-by-prettify">;</span><span style=3D"c=
olor:#000" class=3D"m_1356521278005008546styled-by-prettify"><br>=C2=A0 sec=
ret_float </span><span style=3D"color:#660" class=3D"m_1356521278005008546s=
tyled-by-prettify">=3D</span><span style=3D"color:#000" class=3D"m_13565212=
78005008546styled-by-prettify"> </span><span style=3D"color:#066" class=3D"=
m_1356521278005008546styled-by-prettify">0</span><span style=3D"color:#000"=
 class=3D"m_1356521278005008546styled-by-prettify"><br>=C2=A0 </span><span =
style=3D"color:#008" class=3D"m_1356521278005008546styled-by-prettify">asm<=
/span><span style=3D"color:#000" class=3D"m_1356521278005008546styled-by-pr=
ettify"> </span><span style=3D"color:#008" class=3D"m_1356521278005008546st=
yled-by-prettify">volatile</span><span style=3D"color:#000" class=3D"m_1356=
521278005008546styled-by-prettify"> </span><span style=3D"color:#660" class=
=3D"m_1356521278005008546styled-by-prettify">(</span><span style=3D"color:#=
080" class=3D"m_1356521278005008546styled-by-prettify">&quot;&quot;</span><=
span style=3D"color:#000" class=3D"m_1356521278005008546styled-by-prettify"=
> </span><span style=3D"color:#660" class=3D"m_1356521278005008546styled-by=
-prettify">::</span><span style=3D"color:#080" class=3D"m_13565212780050085=
46styled-by-prettify">&quot;irm&quot;</span><span style=3D"color:#660" clas=
s=3D"m_1356521278005008546styled-by-prettify">(</span><span style=3D"color:=
#000" class=3D"m_1356521278005008546styled-by-prettify">secret_int</span><s=
pan style=3D"color:#660" class=3D"m_1356521278005008546styled-by-prettify">=
),</span><span style=3D"color:#000" class=3D"m_1356521278005008546styled-by=
-prettify"> </span><span style=3D"color:#080" class=3D"m_135652127800500854=
6styled-by-prettify">&quot;xm&quot;</span><span style=3D"color:#660" class=
=3D"m_1356521278005008546styled-by-prettify">(</span><span style=3D"color:#=
000" class=3D"m_1356521278005008546styled-by-prettify">secret_float</span><=
span style=3D"color:#660" class=3D"m_1356521278005008546styled-by-prettify"=
>));</span><span style=3D"color:#000" class=3D"m_1356521278005008546styled-=
by-prettify"><br></span><span style=3D"color:#660" class=3D"m_1356521278005=
008546styled-by-prettify">}</span><span style=3D"color:#000" class=3D"m_135=
6521278005008546styled-by-prettify"><br></span></div></code></div><br>I wou=
ld really like an attribute for that, though.<br><br><br>Le vendredi 28 sep=
tembre 2018 15:36:42 UTC+2, Daniel Gutson a =C3=A9crit=C2=A0:<blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div dir=3D"auto"><div>Yeah.=C2=A0 But please not=
e that this is not only for function calls.<div dir=3D"auto"><br></div><div=
 dir=3D"auto">void f()</div><div dir=3D"auto">{</div><div dir=3D"auto">=C2=
=A0 =C2=A0int secret;</div><div dir=3D"auto">=C2=A0 =C2=A0....</div><div di=
r=3D"auto">=C2=A0 =C2=A0secret =3D 0;=C2=A0 //removed due to DSE</div><div =
dir=3D"auto">}</div><div dir=3D"auto"><br></div><div dir=3D"auto">If I decl=
are secret as volatile or write 0s to its address I may prevent the compile=
r to use a register impacting in performance. That&#39;s why I want to use =
the attribute here too.</div><div dir=3D"auto"><br></div><br><br><div class=
=3D"gmail_quote"><div dir=3D"ltr">El vie., 28 sept. 2018 10:32, Andrew Gies=
e &lt;<a rel=3D"nofollow noreferrer">gies...@gmail.com</a>&gt; escribi=C3=
=B3:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"auto"><div>I like =
the idea.<div dir=3D"auto">Function poisoning might also serve your needs. =
E.g.,=C2=A0<a href=3D"https://www.fluentcpp.com/2018/09/04/function-poisoni=
ng-in-cpp/" rel=3D"nofollow noreferrer" target=3D"_blank">https://www.fluen=
tcpp.com/2018/09/04/function-poisoning-in-cpp/</a></div><div dir=3D"auto"><=
br></div><div dir=3D"auto">If gcc poison were standardized in some fashion,=
 you could write your own wrappers to those functions with all the [[nodisc=
ard]] you might want.</div><div dir=3D"auto"><br></div><div dir=3D"auto">Co=
ntrol in that case is a little less granular, indeed. Probably if you&#39;r=
e writing [[nodiscard]] on a per-expression basis you are not discarding th=
e result already.</div><div dir=3D"auto"><br></div><div dir=3D"auto">Regard=
s</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 rel=3D"nofollow noreferrer">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow noreferrer">std-pr.=
...@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/CAO8_tC4kNZ6s-xMXo69n1D3dbOMkqt0fjLU4=
4Uq5TfABp17hQQ%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter"=
 rel=3D"nofollow noreferrer" target=3D"_blank">https://groups.google.com/a/=
isocpp.org/d/msgid/std-proposals/CAO8_tC4kNZ6s-xMXo69n1D3dbOMkqt0fjLU44Uq5T=
fABp17hQQ%40mail.gmail.com</a>.<br>
</blockquote></div></div></div>
</blockquote></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" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">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/94d79dd7-ba3b-4bf8-91ed-e5dc02b33670%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-propo=
sals/94d79dd7-ba3b-4bf8-91ed-e5dc02b33670%40isocpp.org</a>.<br>
</blockquote></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/CAFdMc-1tpJj3bSzHgD%3DpxWD2eVokRX3ST2=
QE-oF6M8z1%3DDTEoQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFdMc-1tpJj3=
bSzHgD%3DpxWD2eVokRX3ST2QE-oF6M8z1%3DDTEoQ%40mail.gmail.com</a>.<br />

--000000000000ffc75a0576ef1f3f--

.
