[Openmp-dev] [RFC] Change compiler warnings for OpenMP runtimes

Jonas Hahnfeld via Openmp-dev openmp-dev at lists.llvm.org
Wed Aug 7 06:40:40 PDT 2019


Hi all,

I'd like to change the way how compiler warnings are handled for the
OpenMP runtimes (libomp and libomptarget).
tl;dr: I propose to enable all warnings from -Wall and selectively
disable the ones that are not clean right now.

At the moment, the CMake configuration is not very consistent with
respect to compiler warnings: In standalone builds, libomp enables some
warnings while libomptarget is built with only the default warnings
(none, or only flagging very broken code). When built in-tree, LLVM
enables -Wall -Wextra -Wpedantic and then disables some warnings. As a
result, the OpenMP runtimes get exposed to a much larger set of
compiler warnings and from what I've seen, this basically renders the
output from GCC unreadable because it's just full of text.

I like the concept of enabling all warnings and then disable some to
get the build free of warnings. I've put together a patch [1] and I see
no warnings with recent versions of Clang, GCC, and the Intel Compiler.
Additionally, this scheme allows us to enable warnings not covered by
the generic -Wall when helpful, as the linked patch already does.

In that patch, the set of disabled warnings is quite large, but having
a list allows us to remove the -Wno-* arguments one-by-one and correct
the code in question (if possible). I've already started with some easy
ones [2-5] and I hope to do some others, but help would be welcome.

Feedback, comments, and / or review of the patches would be great!

Thanks,
Jonas

1: https://reviews.llvm.org/D65867
2: https://reviews.llvm.org/D65868
3: https://reviews.llvm.org/D65869
4: https://reviews.llvm.org/D65870
5: https://reviews.llvm.org/D65871
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190807/67c741a0/attachment.sig>


More information about the Openmp-dev mailing list