public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66943] New: GCC warns of Unknown Pragma for OpenMP, even though it support it.
@ 2015-07-20  8:00 noloader at gmail dot com
  2015-07-20  8:09 ` [Bug c++/66943] " noloader at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: noloader at gmail dot com @ 2015-07-20  8:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943

            Bug ID: 66943
           Summary: GCC warns of Unknown Pragma for OpenMP, even though it
                    support it.
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: noloader at gmail dot com
  Target Milestone: ---

The following source code results in a slew of Unknown Pragma messages. The
problem is, GCC supports OpenMP. GCC responds properly to -fopenmp, and even
defines _OPENMP when it encounters -fopenmp.

This is related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431, and
managing warnings with pragmas when using -Wall. The relation to 53431 is: I
can't seem to get "pragma GCC diagnostic" to work to ignore the warnings when
-Wall is in effect.

// Defines GCC_DIAGNOSTIC_AWARE if GCC 4.7 or above.
#define GCC_DIAGNOSTIC_AWARE 1

#if GCC_DIAGNOSTIC_AWARE
# pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif

...
Integer ModularRoot(const Integer &a, const Integer &dp, const Integer &dq,
                    const Integer &p, const Integer &q, const Integer &u)
{
    Integer p2, q2;
    #pragma omp parallel
        #pragma omp sections
        {
            #pragma omp section
                p2 = ModularExponentiation((a % p), dp, p);
            #pragma omp section
                q2 = ModularExponentiation((a % q), dq, q);
        }
    return CRT(p2, p, q2, q, u);
}
...

**********

To duplicate:

    git clone https://github.com/weidai11/cryptopp.git cryptopp-warn
    cd cryptopp-warn
    export CXXFLAGS="-g2 -O3 -DNDEBUG -Wall"
    make


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-20 10:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20  8:00 [Bug c++/66943] New: GCC warns of Unknown Pragma for OpenMP, even though it support it noloader at gmail dot com
2015-07-20  8:09 ` [Bug c++/66943] " noloader at gmail dot com
2015-07-20  8:09 ` noloader at gmail dot com
2015-07-20  8:36 ` pinskia at gcc dot gnu.org
2015-07-20  9:14 ` noloader at gmail dot com
2015-07-20  9:58 ` manu at gcc dot gnu.org
2015-07-20 10:36 ` noloader at gmail dot com
2015-07-20 10:44 ` manu at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).