This is an archive of the discontinued LLVM Phabricator instance.

Turn off uninitialized-use warnings for gcc in cmake build
ClosedPublic

Authored by revane on Jan 30 2013, 12:18 PM.

Details

Summary

Copied logic from autoconf/configure.ac and added support to the cmake
build to turn off uninitialized use warnings for gcc. This cleans the
build up somewhat.

Diff Detail

Event Timeline

I don't see anything wrong with this, but I don't know enough CMake to LGTM this.

doug.gregor accepted this revision.Jan 30 2013, 2:05 PM

Gross that we have to do so many checks, but LGTM.

chandlerc requested changes to this revision.Jan 30 2013, 3:26 PM

If I can jump in...

cmake/config-ix.cmake
320–322

So, why not test for -Wmaybe-uninitialized?

Many versions of GCC ignore -Wno-... flags they don't understand, but I think they're very rigorous about supporting a -Wno-... variant for every flag the support a -W... variant of, so test for the positive one.

My expected logic here is:

  • If GCC
    • If -Wmaybe-uninitiaziled is supported, use -Wno-maybe-uninitialized
    • Else use -Wno-uninitialized
revane updated this revision to Unknown Object (????).Jan 31 2013, 6:11 AM

Vast simplification based on reviewer observation that although gcc
won't complain about unsupported -Wno-* flags it *will* complain about
unsupported -W flags. Instead of testing for -Wno-maybe-uninitialized we
test for the positive.

Someone should fix up the logic in autoconf/configure.ac the same way
too.

Argh. I got my branches mixed up and now this diff contains changes for my missing field initializer change. Please ignore that hunk. I'll be sending that for review separately.

revane closed this revision.Feb 3 2013, 6:34 PM

Committed as r174299.