c99 _Pragma operator in OpenMP

Discuss the OpenMP 3.0 API Specifications with the OpenMP Arch. Review Board. (Read Only)
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
PGK
Posts: 5
Joined: Thu Jan 28, 2010 7:38 am

c99 _Pragma operator in OpenMP

Post by PGK »

Hi all,

Is the C99 _Pragma supported by OpenMP? The more common #pragma is first discussed on Page #21:
In C/C++, OpenMP directives are specified by using the #pragma mechanism provided by the C and C++ standards.
Which could imply that a compliant OpenMP c99 compiler would translate something like:

Code: Select all

_Pragma("omp parallel for")
into

Code: Select all

#pragma omp parallel for
and so be compliant.

As well as being an operator, it can appear as a result of macro expansion; e.g.

Code: Select all

#define PARFOR _Pragma("omp parallel for")
In any case, I only have gcc, which does appear to support the use of _Pragma like this for OpenMP. Is this well supported? Do other C99 compilers also support _Pragma?

Cheers,
PGK

Federico

Re: c99 _Pragma operator in OpenMP

Post by Federico »

TO my understanding, independently of OpenMP, a C99 compiler must support both forms, the #pragma directive and the _Pragma unary operator. Thus, it seems to be a matter of C99 compliance of each compiler. You should check with compiler vendor or developer organization. Documentation is available online for most compilers.

Federico

Locked