This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to clear unknown pragma warning for OpenMP?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Jeffrey Walton <noloader at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 23 Jul 2015 18:00:04 +0100
- Subject: Re: How to clear unknown pragma warning for OpenMP?
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8m6XU1LW9cyRL1nZ5eMH_hizr38CLcKRbnm+33Hn6np3Q at mail dot gmail dot com>
On 23 July 2015 at 17:01, Jeffrey Walton wrote:
>
> g++ -DNDEBUG -g2 -O3 -Wall -fPIC -march=native -pipe -c rw.cpp
> rw.cpp:130:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
> #pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)
> ^
Pretty ugly, but if you want the OpenMP directives to be dependent on
whether OpenMP support is actually enabled you could do:
#if _OPENMP
#pragma omp section
#endif
(I haven't tested whether the omp pragma still works this way.)