<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:HelveticaNeue;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I'd be in favor of making them explicitly incompatible. I ran into this recently, found the incompatibility quite surprising, and had to do a bunch of research (looking at the relevant standards, doing experiments across a bunch of compilers
 and standard libraries, etc.) to convince myself that it was expected behavior. An explicit error would be super nice.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">cfe-dev <cfe-dev-bounces@lists.llvm.org> on behalf of cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Reply-To: </b>Volodymyr Sapsai <vsapsai@apple.com><br>
<b>Date: </b>Wednesday, March 7, 2018 at 12:32 PM<br>
<b>To: </b>cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Subject: </b>[cfe-dev] [RFC] Make <atomic> and <stdatomic.h> explicitly incompatible<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><a name="_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">Hello all,<o:p></o:p></span></a></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"><o:p> </o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">Currently atomics are available in C through <stdatomic.h> and in C++ through <atomic>. These headers have some common
 names, so using both of them in the same translation unit usually doesn’t work. The downside is that in some cases diagnostic can be overly verbose and overwhelming. For example, compiling just 2 lines<o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"><o:p> </o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">#include <stdatomic.h><o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">#include <atomic><o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"><o:p> </o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">results in 68 errors.<o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"><o:p> </o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">I am proposing to make these headers explicitly incompatible, so we have just a single error telling so instead of multiple
 errors. What do you think?<o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"><o:p> </o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">Alternative solution is to make these headers compatible. But the consensus seems to be that it’s not the right solution.
 See </span></span><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D26376&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=f2XAChgmKGyURiNTGeNTF1t1Fpo5BLSqNdUKyYAZYeM&s=O1AIlpTPrgXe3-fXW3-VqVGTAUhg2qKBozM1iOtQhbE&e="><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">https://reviews.llvm.org/D26376</span></span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"> for
 more details. There is also a proposal </span></span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__open-2Dstd.org_jtc1_sc22_wg21_docs_papers_2018_p0943r0.html&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=f2XAChgmKGyURiNTGeNTF1t1Fpo5BLSqNdUKyYAZYeM&s=iHKcnTreK84QBWD-j_3_n7ww5ON1-EzKzni3NgSgiaY&e="><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">P0943R0:
 Support C atomics in C++</span></span><span style="mso-bookmark:_MailOriginalBody"></span></a><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">.  As far as I can tell, my proposal doesn’t interfere with P0943R0 but
 will be obsolete if that proposal is accepted. Regardless of the future development I think it is still beneficial to have better diagnostics in the short term.<o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"><o:p> </o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">I am not providing concrete implementation yet, at first I want to know the opinion of the community on the matter.<o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif"><o:p> </o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">Thanks,<o:p></o:p></span></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="mso-bookmark:_MailOriginalBody"><span style="font-family:"HelveticaNeue",serif">Volodymyr<o:p></o:p></span></span></p>
</div>
</div>
</body>
</html>