llvm-project/libcxx
Martin Storsjö b0cc7b53a5 [libcxx] Don't use an undefined '+' in unsigned/octal/hexal print formats
If building code like this:

    unsigned long val = 1000;
    snprintf(buf, sizeof(buf), "%+lu", val);

with clang, clang warns

    warning: flag '+' results in undefined behavior with 'u' conversion specifier [-Wformat]

Therefore, don't construct such undefined format strings. (There's
no compiler warnings here, as the compiler can't inspect dynamically
assembled format strings.)

This fixes number formatting in mingw-w64 if built with
`__USE_MINGW_ANSI_STDIO` defined (there, the '+' flag causes a
leading plus to be printed when formatting unsigned numbers too,
while the '+' flag doesn't cause any extra leading plus in other
stdio implementations).

Differential Revision: https://reviews.llvm.org/D103444
2021-06-04 12:07:30 +03:00
..
benchmarks [libcxx][nfc] prefixes test type `input_iterator` with `cpp17_` 2021-05-02 05:02:59 +00:00
cmake [libc++] Also build the static library in the Apple cache 2021-06-03 18:15:20 -04:00
docs [libc++] Implement LWG3435 (constraints on reverse_iterator and move_iterator) 2021-06-03 15:49:41 -04:00
include [libc++] Define _LIBCPP_NO_NATIVE_SEMAPHORES even outside of pthread 2021-06-03 18:18:42 -04:00
lib [libc++] Disentangle std::pointer_safety 2021-05-03 14:33:49 -04:00
src [libcxx] Don't use an undefined '+' in unsigned/octal/hexal print formats 2021-06-04 12:07:30 +03:00
test [libc++] Implement LWG3435 (constraints on reverse_iterator and move_iterator) 2021-06-03 15:49:41 -04:00
utils [libc++] Simplify apple-install-libcxx since we always use the same CMake cache 2021-06-03 18:26:38 -04:00
www [libcxx] [docs] Update docs about how to build for Windows 2021-03-15 17:30:26 +02:00
.clang-format [libcxx][NFC] removes IndentRequires from .clang-format 2021-04-15 19:28:45 +00:00
.gitignore [libcxx] Fix .gitignore to not exclude test directories 2020-03-25 17:52:23 -07:00
CMakeLists.txt [libc++] Support per-target __config_site in per-target runtime build 2021-04-28 14:27:16 -07:00
CREDITS.TXT [libcxx] Adds [concept.same] 2020-04-08 18:00:13 -04:00
LICENSE.TXT
TODO.TXT [libc++][NFC] Remove outdated TODO item 2020-07-08 13:04:33 -04:00
appveyor-reqs-install.cmd Attempt to upgrade compiler used by appveyor builds 2019-04-03 20:40:01 +00:00
appveyor.yml disable appveyor config for MSVC 2015 2019-04-03 20:36:51 +00:00