This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to clear unknown pragma warning for OpenMP?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 23 Jul 2015 12:01:50 -0400
- Subject: How to clear unknown pragma warning for OpenMP?
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
Here is the next to last issue I'd like to clear before turning on
-Wall under GCC. The file includes the following, but its not
performing as expected.
#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
The befuddling thing (to me) is GCC is OpenMP conforming, so is
_knows_ what '#pragma omp' is, even if its not activated via
'-fopenmp'. There's an open issue on it at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943, but I don't think
its going to get much attention since most code does not use OpenMP.
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)
^
rw.cpp:132:0: warning: ignoring #pragma omp section [-Wunknown-pragmas]
#pragma omp section
^
rw.cpp:134:0: warning: ignoring #pragma omp section [-Wunknown-pragmas]
#pragma omp section
^
rw.cpp:136:0: warning: ignoring #pragma omp section [-Wunknown-pragmas]
#pragma omp section
^
rw.cpp:228:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
#pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)
^
rw.cpp:230:0: warning: ignoring #pragma omp section [-Wunknown-pragmas]
#pragma omp section
^
rw.cpp:234:0: warning: ignoring #pragma omp section [-Wunknown-pragmas]
#pragma omp section
^
...
You can find the file in question at
https://github.com/weidai11/cryptopp/blob/master/rw.cpp. But the
library uses parallel tasks in other places, so its a fairly
widespread issue. On the good side, it localized to library source
files, and it does not cross-pollinate to user code due to library
headers.
Thanks in advance. Jeff.