<html xmlns:v="urn:schemas-microsoft-com:vml" 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 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Book Antiqua";
        panose-1:2 4 6 2 5 3 5 3 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Book Antiqua","serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The # token may be preceded by whitespace; C standard (C99 and C11) 6.10p2 and C++11 chapter 16 p1.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The point of that style is so you can grep for '#include' or '#define' or whatever and be confident you won't miss any.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> cfe-dev [mailto:cfe-dev-bounces@lists.llvm.org]
<b>On Behalf Of </b>Martin J. O'Riordan via cfe-dev<br>
<b>Sent:</b> Wednesday, August 31, 2016 1:21 AM<br>
<b>To:</b> 'Curdeius Curdeius'; 'David Chisnall'<br>
<b>Cc:</b> 'Clang Dev'<br>
<b>Subject:</b> Re: [cfe-dev] [clang-format] Indentation of preprocessor directives<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D">A good point, I’m not 100% sure if it is legal to precede the first ‘</span><span lang="EN-IE" style="font-family:"Courier New";color:black">#</span><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D">’
 with whitespace, though it seems to be commonly accepted.  I’ll have to dig out my ANSI and ISO C documents.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D">I am not familiar with any Opensource project that uses this style, but I have seen it used in various companies I have done work for in the past; indeed, in one
 case it was part of their official coding practices.  Interesting if it is not valid ISO C ;-)  I’ve even seen examples such as:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span lang="EN-IE" style="font-family:"Courier New";color:black">/* comment */ #define foo ...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D">            MartinO<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE" style="font-family:"Book Antiqua","serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Curdeius Curdeius [<a href="mailto:curdeius@gmail.com">mailto:curdeius@gmail.com</a>]
<br>
<b>Sent:</b> 31 August 2016 8:42<br>
<b>To:</b> David Chisnall <<a href="mailto:david.chisnall@cl.cam.ac.uk">david.chisnall@cl.cam.ac.uk</a>>;
<a href="mailto:Martin.ORiordan@movidius.com">Martin.ORiordan@movidius.com</a><br>
<b>Cc:</b> Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [cfe-dev] [clang-format] Indentation of preprocessor directives<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-IE"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-IE">Hi Martin and David, thanks for the interest. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-IE"> <o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-IE">I've had the same impression as David. But certainly, several modern compilers accept indented directives (clang, gcc, mscvc, icc). <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-IE"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-IE">Martin, may you be so kind and give some links to projects that use the space-before-hash style, please? <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-IE"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-IE">Anyway, it is pretty straightforward to add both styles. Do you have any ideas on naming? Should it be a single option (None, AllAfterHash, AllBeforeHash) or 2 options: one defining when to indent and the other - how
 to indent?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-IE"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-IE">Regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-IE">Marek <o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-IE">śr., 31 sie 2016, 08:16 użytkownik David Chisnall <<a href="mailto:david.chisnall@cl.cam.ac.uk" target="_blank">david.chisnall@cl.cam.ac.uk</a>> napisał:<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-IE">On 30 Aug 2016, at 21:36, Martin J. O'Riordan via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@  tous upór lists.llvm.org</a>> wrote:<br>
><br>
> and whitespace indentation preceding the ‘#’ prefixed pre-processing directive:<br>
<br>
Is doing this even valid?  I was under the impression that the C preprocessor required the hash to be on column 0.  I’ve certainly had compilers reject code in the past where the preprocessor directives were indented accidentally.<br>
<br>
David<o:p></o:p></span></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-IE">-- <o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-IE">Marek<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>