[cfe-dev] [clang-format] Indentation of preprocessor directives

Curdeius Curdeius via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 31 00:42:09 PDT 2016


Hi Martin and David, thanks for the interest.

I've had the same impression as David. But certainly, several modern
compilers accept indented directives (clang, gcc, mscvc, icc).

Martin, may you be so kind and give some links to projects that use the
space-before-hash style, please?

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?

Regards,
Marek

śr., 31 sie 2016, 08:16 użytkownik David Chisnall <
david.chisnall at cl.cam.ac.uk> napisał:

> On 30 Aug 2016, at 21:36, Martin J. O'Riordan via cfe-dev <cfe-dev@  tous
> upór lists.llvm.org <cfe-dev at lists.llvm.org>> wrote:
> >
> > and whitespace indentation preceding the ‘#’ prefixed pre-processing
> directive:
>
> 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.
>
> David
>
> --
Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160831/dae70cbf/attachment.html>


More information about the cfe-dev mailing list