This is an archive of the discontinued LLVM Phabricator instance.

Fix or suppress GCC warnings during build.
ClosedPublic

Authored by EricWF on Aug 29 2016, 1:46 PM.

Details

Summary

Currently a number of GCC warnings are emitted when building libc++. This patch fixes or ignores all of them. The primary changes are:

  • Work around strict aliasing issues in typeinfo::hash_code() by using attribute((may_alias)). However I think a non-aliasing hash_code() implementation is possible. Further investigation needed.
  • Add _LIBCPP_UNREACHABLE() to switch in strstream.cpp to avoid -Wpotentially-uninitialized.
  • Fix -Wunused-value warning in __all by adding a void cast.
  • Ignore -Wattributes for now. There are a number of real attribute issues when using GCC but enabling the warning is too noisy.
  • Ignore -Wliteral-suffix since it warns about the use of reserved identifiers. Note Only GCC 7.0 supports disabling this warning.
  • Ignore -Wc++14-compat since it warns about the sized new/delete overloads.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 69608.Aug 29 2016, 1:46 PM
EricWF retitled this revision from to Fix or suppress GCC warnings during build..
EricWF updated this object.
EricWF updated this revision to Diff 69611.Aug 29 2016, 1:48 PM
EricWF updated this object.
EricWF updated this object.
EricWF accepted this revision.Aug 29 2016, 1:51 PM
EricWF updated this revision to Diff 69612.
EricWF added a reviewer: EricWF.
This revision is now accepted and ready to land.Aug 29 2016, 1:51 PM
EricWF closed this revision.Aug 29 2016, 1:51 PM