Many preprocessors will not accept the input you propose. The *directive* can
be indented, but many (perhaps most) preprocessors still expect the '#' to
appear in column 1.

Jonathan

On Fri, May 4, 2012 at 6:33 PM, Mohammad Mirzadeh <mirza...@gmail.com>wrote:

> 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 <rea...@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@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>
>
_______________________________________________
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to