[Bug c++/66943] GCC warns of Unknown Pragma for OpenMP, even though it support it.

noloader at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Jul 20 11:06:00 GMT 2015


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

--- Comment #8 from Jeffrey Walton <noloader at gmail dot com> ---
(In reply to Jeffrey Walton from comment #6)
> > Maybe it could be in effect with `-Wextra`?
> 
> That would just move the problem somewhere else instead of fixing it. Many
> people do compile with -Wall -Wextra (like GCC itself).

Yeah, but it works for me :) But more seriously, I understand what you are
saying. When I have the luxury of a new project, I use -Wall -Wextra
-Wconversion.

> 
> > Enabling Unknown Pragma warnings for #pragma omp under -Wall when the
> > compiler supports it, coupled with the inability to manage warnings with
> > 'pragma GCC diagnostic` (Bug #53431), means we just turned OFF -Wall. We are
> > moving in the wrong direction :(
> 
> You could always use -Wall -Wno-unknown-pragmas, but yes, fixing PR53431
> seems the key here. I hope someone finds time to do that before GCC 6 closes
> for development.

-Wno-unknown-pragmas is just one of many we need. Others appear to include
-Wunused-variable, -Wunused-value and -Wunused-function. And we are no longer
managing the warnings in the source code through a GCC diagnostic block;
rather, we are polluting the command line.

We produce a library, so we not only pollute our command line, we polute the
user's command line. That's after the user complains about it because GCC
diagnostic block don't "just work".

Does GCC have a Bounty program? If so, I'd be happy to make a donation. I'd
even solicit a for grants because `-Wall` and managing warnings is *that*
important. I feel awful that we yanked it for GCC.

On the good side, our sources are cross-compiler and cross-platform, So we are
effectively using -Wall for MSVC, Clang and ICC. But others don't have that
luxury. For example, the Asterisk project uses trampolines, so the code does
not compile under Clang (and it could never compile under MSVC).



More information about the Gcc-bugs mailing list