[Qt-creator] indent preprocessor directives

Atlant Schmidt aschmidt at dekaresearch.com
Fri May 4 22:02:49 CEST 2012


Nikos, et al.:

> Indenting preprocessor directives is perfectly acceptable by the standard.

  Pre-ANSI C, when many of us learned to type, that wasn't
  the case; preprocessor directives had to start in column 1.
  But ANSI C has been around for a long time now... ;-)

                           Atlant

-----Original Message-----
From: qt-creator-bounces+aschmidt=dekaresearch.com at qt-project.org [mailto:qt-creator-bounces+aschmidt=dekaresearch.com at qt-project.org] On Behalf Of Nikos Chantziaras
Sent: Friday, May 04, 2012 11:31
To: qt-creator at qt-project.org
Subject: Re: [Qt-creator] indent preprocessor directives

On 20/04/12 17:44, Erik Verbruggen wrote:
>
> On Apr 20, 2012, at 2:41, Mohammad Mirzadeh wrote:
>
>> Hey guys,
>>
>> Is there a way to tell QtCreator to indent directives appropriately? I don't seem to find an option under the code style ...
>
> No, there are no options for the preprocessor directives. Qt Creator will put a # at the start of the line, which is what the C(++) standard(s) require.

The standards don't require such a thing:

The C standard says:

   A preprocessing directive consists of a sequence of preprocessing
   tokens that begins with a # preprocessing token that (at the start
   of translation phase 4) is either the first character in the source
   file (optionally after white space containing no new-line characters)
   or that follows white space containing at least one new-line
   character, and is ended by the next new-line character.

Indenting preprocessor directives is perfectly acceptable by the standard.

_______________________________________________
Qt-creator mailing list
Qt-creator at qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.



More information about the Qt-creator mailing list