aligned_alloc() is implemented in terms of posix_memalign() which is
only declared in <stdlib.h> but not defined in Newlib in general. At
least Linux and RTEMS implement this function.
newlib/ChangeLog
2015-10-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add
alloc_aligned.c.c.
* libc/stdlib/Makefile.in: Regenerate.
* libc/stdlib/aligned_alloc.c: New.
Import some <stdlib.h> function declarations from latest FreeBSD and
implement them. I am not sure if we should call the global reent
cleanup in quick_exit() similar to exit().
newlib/ChangeLog
2015-10-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/stdlib.h (at_quick_exit): Declare.
(quick_exit): Likewise.
* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add
quick_exit.c.
* libc/stdlib/Makefile.in: Regenerate.
* libc/stdlib/quick_exit.c: New.
I think these are accidental omissions, as these source files are listed to be
chewed by makedoc, but the result is not included by any texinfo source file.
Future work: Nothing in libc/reent/ which is processed by makedoc is included by
reent.tex
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdlib/stdlib.tex: Include itoa and utoa, and add to menu.
* libc/string/strings.tex: Include memrchr and rawmemchr, and add
to menu.
* libm/math/math.tex: Include exp10 and pow10, and add to menu.
* libm/common/s_exp10.c: Improve one-line description.
* libm/common/s_exp10.c: Ditto.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Don't chew files which contain no documentation markup.
Neither of the alternatives for MALLOCR (mallocr.c or nano-mallocr.c) contain
any documentation markup.
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdlib/Makefile.am (CHEWOUT_FILES): Remove $(MALLOCR).def.
* libc/stdio/Makefile.am (CHEWOUT_FILES): Remove getwc.def and
putwc.def.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Fix typo-ed function names in efgcvt.c documentation, neither gvcvt nor gdvtf
exists.
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdlib/efgcvt.c: Fix typo-ed function names in
documentation.
* libc/stdlib/stdlib.tex: Fix function name in menu to match.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdlib/llabs.c: Mark up parameter name in ANSI_SYNOPSIS.
* libc/time/tzset.c: Add and mark up parameter in SYNOPSIS.
* libm/common/s_nan.c: Ditto.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
"const char *".
* newlib/libc/stdlib/getopt.c (getopt_internal): Use fputs()/fputc()
instead of fprintf() to save code space. Fix signed/unsigned
comparison.
* libc/stdlib/nano-mallocr.c (RONECALL): New parameter macro.
(sbrk_start): New variable.
(current_mallinfo, free_list): Forward declaration of data.
(chunk): Define size as long type.
(mallinfo): Synchronize with latest malloc.h.
(nano_*): Forward declaration of functions.
(get_chunk_from_ptr): Defined to static inline.
(nano_mallinfo): Implement this function.
(nano_malloc_stats): Implement this function.
Lite exit support.
* README: Add information about lite-exit.
* acconfig.h (_LITE_EXIT): New macro.
* configure.in (enable-lite-exit): New option.
(_LITE_EXIT): Define new macro.
* configure: Regenerated.
* newlib.hin (_LITE_EXIT): New macro.
* libc/stdlib/__atexit.c [_LITE_EXIT]: Add dummy explicit
reference to __call_exitprocs.
* libc/stdlib/cxa_atexit.c [_LITE_EXIT]: Make __register_exitproc a
weak reference.
* libc/stdlib/exit.c (exit)[_LITE_EXIT]: Remove TWS and weakly reference
__call_exitprocs.
* libc/include/sys/config.h (_REENT_GLOBAL_ATEXIT): Define for
RTEMS.
* libc/include/sys/reent.h (_reent): Use _REENT_GLOBAL_ATEXIT.
(_global_atexit): Declare if _REENT_GLOBAL_ATEXIT is defined.
* libc/reent/reent.c (_reclaim_reent): Remove atexit cleanup if
_REENT_GLOBAL_ATEXIT is defined.
(_wrapup_reent): Remove atexit handling if _REENT_GLOBAL_ATEXIT
is defined.
* libc/stdlib/__atexit.c (_global_atexit0): Define if
_REENT_GLOBAL_ATEXIT is defined.
* libc/stdlib/__call_atexit.c (_global_atexit): Define if
_REENT_GLOBAL_ATEXIT is defined.
compiler warnings found this way.
* libc/stdio/freopen.c (_freopen_r): Fix bug setting _flags.
* libc/include/stdio.h (_rename): Define when building newlib.
* libc/include/sys/signal.h (_kill): Ditto.
* libc/include/sys/stat.h (_mkdir): Ditto.
* libc/include/sys/time.h (_gettimeofday): Ditto.
* libc/include/sys/times.h (_times): Ditto.
* libc/include/sys/wait.h (_wait): Ditto.
* libc/locale/lmessages.c (empty): Don't define for Cygwin.
* libc/locale/lmonetary.c (cnv): Ditto.
* libc/locale/nl_langinfo.c (nl_langinfo): Ditto for variable s.
* libc/posix/collate.c: Throughout cast to avoid compiler warning.
* libc/posix/engine.c (matcher): Initialize dp to avoid compiler
warning.
* libc/posix/glob.c: Disable on Cygwin. Explain why.
* libc/posix/regcomp.c: Fix "uninitialized" compiler warnings.
(dissect): Deliberately silence gcc compiler warning. Add comment to
explain why.
* libc/posix/wordexp.c (wordexp): Remove num_bytes variable since result
is never used.
* libc/posix/popen.c (popen): Ditto for variable last.
* libc/reent/mkdirr.c: Include sys/stat.h.
* libc/reent/renamer.c: Include stdio.h.
* libc/search/hash.c: Throughout use underscored variants of the stat
function family.
(init_hash): Add missing definition for the __USE_INTERNAL_STAT64 case.
* libc/search/hash_bigkey.c (__big_insert): Add parenthesis to avoid
compiler warning.
* libc/search/hash_page.c (overflow_page): Initalize freep to NULL to
avoid compiler warning.
* libc/stdio/asiprintf.c (_asiprintf_r): Cast unsigned char * to char *
to avoid compiler warning.
(asiprintf): Ditto.
* libc/stdio/asprintf.c (_asprintf_r): Ditto.
(asprintf): Ditto.
* libc/stdio/vasiprintf.c (_vasiprintf_r): Ditto.
* libc/stdio/vasprintf.c (_vasprintf_r): Ditto.
* libc/stdio/mktemp.c (_gettemp): Cast to unsigned char in call to
isdigit to avoid compiler warning.
* libc/stdio/vfprintf.c (_VFPRINTF_R): Initialize variables used for
grouping to avoid compiler warning. Only define and set nseps and
nrepeats if they are really used.
* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Ditto. Only define state if
it is really used.
* libc/stdio/vfscanf.c (u_char): Revert to be defined as unsigned char.
(__SVFSCANF_R): Cast fmt in call to __mbtowc.
* libc/stdlib/mbtowc_r.c (JIS_state_table): Disable when building
Cygwin.
(JIS_action_table): Ditto.
* libc/stdlib/wctomb_r.c (__utf8_wctomb): Add parenthesis to avoid
compiler warning.
* libc/string/strcasestr.c: Deliberately silence gcc compiler warning.
Add comment to explain why.
* libc/time/strptime.c (strptime): Cast to unsigned char in calls to
isspace to avoid compiler warning.
* libm/math/e_atan2.c (__ieee754_atan2): Add parenthesis to avoid
compiler warning.
* libm/math/e_exp.c (__ieee754_exp): Initialize k to 0 to avoid
compiler warning. Drop setting it to 0 later.
* libm/math/ef_exp.c (__ieee754_expf): Ditto.
* libm/math/e_pow.c (__ieee754_pow): Add braces to avoid compiler
warning.
* libm/math/ef_pow.c (__ieee754_powf): Ditto.
* libm/math/er_lgamma.c (__ieee754_lgamma_r): Initialize nadj to 0 to
avoid compiler warning.
* libm/math/erf_lgamma.c (__ieee754_lgammaf_r): Ditto.
* libm/math/e_rem_pio2.c (__ieee754_rem_pio2): Ditto for variable z.
* libm/common/sf_round.c (roundf): Remove signbit variable since result
is never used.
* libc/stdlib/strtol.c: Make sure signed characters are not
sign-extended when converted to int and passed to ctype macros.
* libc/stdlib/strtoul.c: Ditto.
* libc/stdlib/strtoll_r.c: Ditto.
* libc/stdlib/strtoull_r.c: Ditto.
* configure.in: Add test for enable-newlib-register-fini
to set the _WANT_REGISTER_FINI flag.
* configure: Regenerated.
* Makefile.in: Ditto.
* newlib.hin: Add _WANT_REGISTER_FINI flag.
* libc/stdlib/__call_atexit.c: Add test for
_WANT_REGISTER_FINI to enable the register_fini function.