[Qt-creator] indent preprocessor directives

Oswald Buddenhagen oswald.buddenhagen at nokia.com
Mon May 7 10:30:34 CEST 2012


On Fri, May 04, 2012 at 06:31:17PM +0300, ext Nikos Chantziaras wrote:
> The C standard says: [...]
> 
> Indenting preprocessor directives is perfectly acceptable by the standard.
> 
while this is correct, it's still just stupid to indent preprocessor
directives with the rest of the code. it is a *pre*-processor. it is a
semantically different beast, which messes with the C++ AST. by
pretending that it is part of the regular code stream, you aim your gun
straight at your foot, and it's only a matter of time until something
pulls the trigger. also, hash directives lined up with other code simply
look wrong, both visually and intuitively for the above reasons. ergo,
don't do it, and creator's behavior is just fine. though i wouldn't
complain if it gained auto-indent *within* the hash directives.



More information about the Qt-creator mailing list