This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Support enabling -Werror in the OpenMP runtime CMake build and clean up the build.
ClosedPublic

Authored by chandlerc on Jul 16 2015, 12:07 AM.

Details

Summary

This disables all of the Clang warnings that fire for me when building
libomp.so on Linux with a recent Clang binary. Lots of these should
probably be fixed, but I want to at least get the build warning-clean
and make it easy to keep that way.

I also switched a bunch of the warnings that are used both for C and C++
compiles to check the flag with C compilation test.

Diff Detail

Event Timeline

chandlerc updated this revision to Diff 29869.Jul 16 2015, 12:07 AM
chandlerc retitled this revision from to [cmake] Support enabling -Werror in the OpenMP runtime CMake build and clean up the build..
chandlerc updated this object.
chandlerc added a reviewer: jlpeyton.
chandlerc added a subscriber: openmp-commits.
jlpeyton added inline comments.Jul 16 2015, 8:34 AM
runtime/CMakeLists.txt
44

I think this should be FALSE. Even LLVM has it off by default. For example, on Linux building x86_64, gcc 4.8 warns that it might not be able to inline something that has an "always inline" attribute.

Good catch. Anything else? Not at a computer to update the patch but I will be later.

runtime/CMakeLists.txt
44

Of course, sorry. Will fix.

jlpeyton edited edge metadata.Jul 16 2015, 9:02 AM

Nope, that's the only thing. After that change, you can commit. Thanks for doing this! Jack Howarth and I had been doing work earlier to try and clean up some of these warnings, but I know there are still many to fix still. Now we can go through and clean up the warnings piecemeal by commenting out a -Wflag.

P.S. If anyone is wondering why we test for -Wflag and not -Wno-flag, it is because I saw gcc 4.8 and 4.9 accept '-Wno-this-cannot-be-a-flag' as a flag, but it did not accept '-Wthis-cannot-be-a-flag'.

jlpeyton accepted this revision.Jul 16 2015, 9:05 AM
jlpeyton edited edge metadata.

Officially accept after the one word fix.

This revision is now accepted and ready to land.Jul 16 2015, 9:05 AM
This revision was automatically updated to reflect the committed changes.