This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to clear unknown pragma warning for OpenMP?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]