[0/6] Fixes inspired by building with clang

Message ID 20200820221449.686006-1-keithp@keithp.com
Headers show
Series
  • Fixes inspired by building with clang
Related show

Message

Torbjorn SVENSSON via Newlib Aug. 20, 2020, 10:14 p.m.
I had a picolibc user building the library with clang and they
reported a number of warnings. I also have another minor nano-mallocr
patch in this series.

 * [PATCH 1/6] libm/stdlib: Recover from realloc failure when shrinking

Last in my nano-mallocr series -- this has realloc always succeed when
shrinking the allocation.

 * [PATCH 2/6] libc/iconv: Check ces handlers table value in

This catches a failure which would otherwise be missed causing crashes
later on.

 * [PATCH 3/6] Avoid implicit floating point conversions

A large-ish patch that fixes warnings generated by clang's
-Wdouble-promotion flag. Fixing these will avoid accidentally using
double-precision computations, which can be expensive on machines
without hardware double support.

 * [PATCH 4/6] libc/stdlib: Undefined shift negative value in a64l

This code was using undefined behaviour from the compiler. As GCC and
clang both continue to 'improve', it's good to keep undefined
behaviour out of code.

 * [PATCH 5/6] libc/stdlib: Clean up clang warnings
 * [PATCH 6/6] libc/stdio: Conditionally declare vars for

These just fix some warnings generated when compiling with various
configurations using clang.  None of these should change the resulting
code.