[Qt-creator] indent preprocessor directives

Mohammad Mirzadeh mirzadeh at gmail.com
Sat May 5 03:33:52 CEST 2012


Well in the example I wrote I need to have

int main()

{

    #pragma omp parallel

    {

        cout << "Hello world from thread # " << omp_get_thread_num() << endl;

    }

    return 0;

}


instead of

int main()

{

#pragma omp parallel

    {

        cout << "Hello world from thread # " << omp_get_thread_num() << endl;

    }

    return 0;

}


This is OK for this example, but for longer ones with couple of nested code
blocks, its gets annoying since # starts at column 1 but the code blocks
are potentially anywhere




On Fri, May 4, 2012 at 1:16 PM, Nikos Chantziaras <realnc at gmail.com> wrote:

> On 04/05/12 23:02, Atlant Schmidt wrote:
> > 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... ;-)
>
> Since this is C++, we don't even need to care. You can't write Qt
> programs with pre-ANSI C compilers to begin with :-)
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20120504/110f46a2/attachment.html>


More information about the Qt-creator mailing list