llvm-project/libcxx/src
Eric Fiselier f6ac565031 Fix or suppress GCC warnings during build.
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.



Reviewers: EricWF

Differential Revision: https://reviews.llvm.org/D24003

llvm-svn: 280007
2016-08-29 20:43:38 +00:00
..
experimental Followon to r279744. Find the other exception types and make __throw_XXX routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore. 2016-08-25 17:47:09 +00:00
include Fixing 'Aquire' typo and libcxx build. 2016-08-02 13:43:48 +00:00
support Move atomic_support.h and config_elast.h into src/include 2015-08-18 21:08:54 +00:00
algorithm.cpp Refactor pthread usage of libcxx. 2016-05-06 14:06:29 +00:00
any.cpp [libcxx] Add std::any 2016-08-11 03:13:11 +00:00
bind.cpp Implement LWG 2488 - Make the placeholders constexpr. 2016-06-26 21:01:34 +00:00
chrono.cpp Remove workarounds for C++17 inline variable ABI break. It has been fixed in clang. 2016-07-02 03:21:58 +00:00
condition_variable.cpp Refactor pthread usage of libcxx. 2016-05-06 14:06:29 +00:00
debug.cpp Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. 2016-08-25 15:09:01 +00:00
exception.cpp Remove a long-standing __has_include hack. 2015-10-16 11:14:30 +00:00
future.cpp Make it possible to build a no-exceptions variant of libcxx. 2015-11-10 11:41:22 +00:00
hash.cpp Fix typos 2014-05-15 11:27:39 +00:00
ios.cpp [libcxx] Allow use of <atomic> in C++03. Try 3. 2015-08-19 17:21:46 +00:00
iostream.cpp Make the presence of stdin and stdout optional. 2015-03-26 14:35:46 +00:00
locale.cpp Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. 2016-08-25 15:09:01 +00:00
memory.cpp Fixing 'Aquire' typo and libcxx build. 2016-08-02 13:43:48 +00:00
mutex.cpp Refactor pthread usage of libcxx. 2016-05-06 14:06:29 +00:00
new.cpp Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. 2016-08-25 15:09:01 +00:00
optional.cpp Add all the relational operators to std::experimental::optional. Also update bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though. 2014-12-09 14:49:17 +00:00
random.cpp Add support for arc4random() to random_device. 2015-03-10 07:46:06 +00:00
regex.cpp [libcxx] Remove pragmas that were needed to suppress warnings produced 2016-01-28 06:13:36 +00:00
shared_mutex.cpp Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480 2015-06-30 14:04:14 +00:00
stdexcept.cpp Fix an unfortunate yet old typo that never got attention before r250507. 2015-10-16 11:26:26 +00:00
string.cpp Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. 2016-08-25 15:09:01 +00:00
strstream.cpp Fix or suppress GCC warnings during build. 2016-08-29 20:43:38 +00:00
system_error.cpp Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. 2016-08-25 15:09:01 +00:00
thread.cpp Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. 2016-08-25 15:09:01 +00:00
typeinfo.cpp Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. 2016-08-25 15:09:01 +00:00
utility.cpp
valarray.cpp Revert "Turn off extern templates for most uses." 2014-08-15 17:58:56 +00:00