summaryrefslogtreecommitdiff
path: root/src/strstream.cpp
AgeCommit message (Collapse)Author
2016-08-29Fix or suppress GCC warnings during build.Eric Fiselier
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@280007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29[libcxx] Fix a bug in strstreambuf::overflow.Akira Hatanaka
The end pointer should point to one past the end of the newly allocated buffer. rdar://problem/24265174 Differential Revision: http://reviews.llvm.org/D20334 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274132 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-19Fix various undefined behavior found by UBSan.Eric Fiselier
* Fix non-null violation in strstream.cpp Overflow was calling memcpy with a null parameter and a size of 0. * Fix std/atomics/atomics.flag/ tests: a.test_and_set() was reading from an uninitialized atomic, but wasn't using the value. The tests now clear the flag before performing the first test_and_set. This allows UBSAN to test that clear doesn't read an invalid value. * Fix std/experimental/algorithms/alg.random.sample/sample.pass.cpp The tests were dereferencing a past-the-end pointer to an array so that they could do pointer arithmetic with it. Instead of dereference the iterator I changed the tests to use the special 'base()' test iterator method. * Add -fno-sanitize=float-divide-by-zero to suppress division by zero UBSAN diagnostics. The tests that cause float division by zero are explicitly aware that they are doing that. Since this is well defined for IEEE floats suppress the warnings for now. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273107 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-04Switch to using C++ style casts.Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198505 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-13Patch from GM to make more implicit bools explicit since we can't stop MSVC ↵Marshall Clow
warning about this in headers and to warn is the MSVC default. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14Fix signed/unsigned warnings when building libc++ in C++14 modeMarshall Clow
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188395 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Marshall Clow found this memory problem in strstream using ↵Howard Hinnant
-fsanitize=address on the test suite. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177452 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01Quash a whole bunch of warningsHoward Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07Fixing up some ABI issuesHoward Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30_STD -> _VSTD to avoid macro clash on windowsHoward Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14Chris Jefferson noted many places where function calls needed to be ↵Howard Hinnant
qualified (thanks Chris). git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@125510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27clang found a missing return statement.Howard Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@124431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16license changeHoward Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04Changed __config to react to all of clang's currently documented has_feature ↵Howard Hinnant
flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@113086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22Fixing whitespace problemsHoward Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@111751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11libcxx initial importHoward Hinnant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8