summaryrefslogtreecommitdiffstats
path: root/include/cstdlib
Commit message (Collapse)AuthorAgeFilesLines
* Remove mblen(), mbtowc() and wctomb() from the thread-unsafe functions.Ed Schouten2016-12-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in r240527 I added a knob to prevent thread-unsafe functions from being exposed. mblen(), mbtowc() and wctomb() were also added to this list, as the latest issue of POSIX doesn't require these functions to be thread-safe. It turns out that the only circumstance in which these functions are not thread-safe is in case they are used in combination with state-dependent character sets (e.g., Shift-JIS). According to Austin Group Bug 708, these character sets "[...] are mostly a relic of the past and which were never supported on most POSIX systems". Though in many cases the use of these functions can be prevented by using the reentrant counterparts, they are the only functions that allow you to query whether the locale's character set is state-dependent. This means that omitting these functions removes actual functionality. Let's be a bit less pedantic and drop the guards around these functions. Links: http://austingroupbugs.net/view.php?id=708 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2037.htm Reviewed by: ericwf Differential Revision: https://reviews.llvm.org/D21436 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290748 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix or suppress GCC warnings during build.Eric Fiselier2016-08-291-0/+6
| | | | | | | | | | | | | | | | | | | | 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
* Split <stdlib.h> out of <cstdlib>.Richard Smith2015-10-091-22/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@249800 91177308-0d34-0410-b5e6-96231b3b80d8
* Make support for thread-unsafe C functions optional.Ed Schouten2015-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | One of the aspects of CloudABI is that it aims to help you write code that is thread-safe out of the box. This is very important if you want to write libraries that are easy to reuse. For CloudABI we decided to not provide the thread-unsafe functions. So far this is working out pretty well, as thread-unsafety issues are detected really early on. The following patch adds a knob to libc++, _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable thread-unsafe functions that can easily be avoided in practice. The following functions are not thread-safe: - <clocale>: locale handles should be preferred over setlocale(). - <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over their non-restartable counterparts. - <ctime>: asctime(), ctime(), gmtime() and localtime() are not thread-safe. The first two are also deprecated by POSIX. Differential Revision: http://reviews.llvm.org/D8703 Reviewed by: marshall git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240527 91177308-0d34-0410-b5e6-96231b3b80d8
* Make *abs() and *div() work on CloudABI.Ed Schouten2015-03-161-0/+6
| | | | | | | | | According to POSIX, *abs() and *div() are allowed to be macros (in addition to being functions). Make sure we undefine these, so that std::*abs() and std::*div() work as expected. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232379 91177308-0d34-0410-b5e6-96231b3b80d8
* Xing Xue: port to IBM XLC++/AIX.Howard Hinnant2013-08-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188396 91177308-0d34-0410-b5e6-96231b3b80d8
* Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which isHoward Hinnant2013-08-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can also define _MSC_VER, and MSVCRT is not necessarily the only C runtime, these macros should not be used interchangeably. This patch divides all Windows-related bits into the aforementioned categories. Two new macros are introduced: - _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using _MSC_VER, excluding Clang. - _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default when _WIN32 is defined. This leaves _WIN32 for code using the Windows API. This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF. Nico, please prepare a patch for CREDITS.TXT, thanks. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187593 91177308-0d34-0410-b5e6-96231b3b80d8
* Dimitry Andric: When using libc++ headers on FreeBSD, in combination with ↵Howard Hinnant2012-11-261-0/+16
| | | | | | | | | | -std=c++98, -ansi or -std=c++03, the long long type is not supported. So in this case, several functions and types, like lldiv_t, strtoll(), are not declared. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@168610 91177308-0d34-0410-b5e6-96231b3b80d8
* Dimitry Andric: FreeBSD only: Add the C11 aligned_alloc to <cstdlib> and ↵Howard Hinnant2012-10-131-0/+6
| | | | | | adjust the inclusion of quick_exit. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@165882 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply noexcept to those functions implemented in <cstdlib> as a conforming ↵Howard Hinnant2012-07-061-4/+4
| | | | | | extension. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@159850 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure [at_]quick_exit is in std::David Chisnall2012-03-141-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@152717 91177308-0d34-0410-b5e6-96231b3b80d8
* Solaris port. Currently sees around 200 test failures, mostly related toDavid Chisnall2012-02-291-1/+2
| | | | | | | | | | | | Solaris not providing some of the locales that the test suite uses. Note: This depends on an xlocale (partial) implementation for Solaris and a couple of fixed standard headers. These will be committed to a branch later today. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@151720 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows port work by Ruben Van BoxemHoward Hinnant2011-10-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@143105 91177308-0d34-0410-b5e6-96231b3b80d8
* More windows port work by Ruben Van BoxemHoward Hinnant2011-10-221-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@142732 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@142235 91177308-0d34-0410-b5e6-96231b3b80d8
* license changeHoward Hinnant2010-11-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119395 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing whitespace problemsHoward Hinnant2010-08-221-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@111750 91177308-0d34-0410-b5e6-96231b3b80d8
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103516 91177308-0d34-0410-b5e6-96231b3b80d8
* libcxx initial importHoward Hinnant2010-05-111-0/+138
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8