<div dir="ltr">Can you attach this to <a href="https://llvm.org/bugs/show_bug.cgi?id=17362">https://llvm.org/bugs/show_bug.cgi?id=17362</a> ?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 31, 2016 at 10:20 AM, Martin J. O'Riordan via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-IE" link="blue" vlink="purple"><div class="m_7811265722218705921WordSection1"><p class="MsoNormal"><span 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 style="font-family:"Courier New";color:black">#</span><span 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.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span 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:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal" style="margin-left:36.0pt"><span style="font-family:"Courier New";color:black">/* comment */ #define foo ...<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#1f497d">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#1f497d">            MartinO<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:"Book Antiqua",serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Curdeius Curdeius [mailto:<a href="mailto:curdeius@gmail.com" target="_blank">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" target="_blank">david.chisnall@cl.cam.ac.uk</a>>; <a href="mailto:Martin.ORiordan@movidius.com" target="_blank">Martin.ORiordan@movidius.com</a><br><b>Cc:</b> Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br><b>Subject:</b> Re: [cfe-dev] [clang-format] Indentation of preprocessor directives<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">Hi Martin and David, thanks for the interest. <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal">I've had the same impression as David. But certainly, several modern compilers accept indented directives (clang, gcc, mscvc, icc). <u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Martin, may you be so kind and give some links to projects that use the space-before-hash style, please? <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">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?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Regards,<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Marek <u></u><u></u></p><div><div><p class="MsoNormal">ś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ł:<u></u><u></u></p></div></div></div></div></div><div><div><div><div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><p class="MsoNormal" style="margin-bottom:12.0pt">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<u></u><u></u></p></blockquote></div></div></div></div></div><div><p class="MsoNormal">-- <u></u><u></u></p></div><div><div><p class="MsoNormal">Marek<u></u><u></u></p></div></div></div></div></div></div><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>