As a commonly-included header, the #define basename in <string.h> can
affect code which uses "basename" for its own purposes (e.g. struct
members or C++ namespaced functions). When such cases occur and some
code includes <string.h> and some not, then errors result. OTOH,
<libgen.h> is rarely used, and that's where the renaming occurs in
glibc, so code using <libgen.h> should already be safe.
* libc/include/libgen.h (basename): Define as __xpg_basename
for source compatibility with glibc.
Declare with __ASMNAME("basename") for ABI compatibility.
* libc/include/string.h (basename): Define as basename for
source compatibility with glibc.
Declare with __ASMNAME("__gnu_basename") for ABI compatibility.
https://sourceware.org/ml/newlib/2015/msg00520.html describes
how sys/time.h uses __BSD_VISIBLE while the types used in the
affected inline functions are guarded with !_POSIX_SOURCE.
Fix that by guarding the type with __BSD_VISIBLE as well.
* libc/include/sys/time.h: Explicitely include sys/cdefs.h.
* libc/include/sys/types.h: Ditto. Guard BSD convenience base types
with __BSD_VISIBLE rather than !_POSIX_SOURCE.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
The CHECK_INIT() is necessary before the _newlib_flockfile_start() since
this would use otherwise acquire an uninitialized lock which gets
initialized after this leading to a corrupt release.
newlib/ChangeLog
2015-07-01 Sebastian Huber <sebastian.huber@embedded-brains.de>
libc/stdio/fputs.c (_puts_r): Add missing CHECK_INIT().
libc/stdio/gets.c (_gets_r): Add missing _REENT_SMALL_CHECK_INIT() and
CHECK_INIT(). Use _stdin_r() to get the file pointer instead of stdin.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
These source files have makedoc markup, but aren't listed to be chewed by
makedoc. I am assuming that is accidental.
Future work: Note that stdio/fseeko.c, stdio/ftello.c and common/s_isnand.c have
makedoc markup, but duplicate stdio/fseek.c, stdio/ftell.c and common/s_isnan.c
respectively.
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/ctype/Makefile.am (CHEWOUT_FILES): Add isblank.def.
* libc/ctype/ctype.tex: Include isblank and add to menu.
* libc/posix/Makefile.am (CHEWOUT_FILES): Add posix_spawn.def.
* libc/posix/posix.tex: Include posix_spawn and add to menu.
* libc/stdio64/Makefile.am (CHEWOUT_FILES): Add fdopen.def.
* libc/stdio64/stdio64.tex: Include fdopen64 and add to menu.
* libc/stdio64/fdopen64.c: Improve one-line description.
* libc/string/Makefile.am (CHEWOUT_FILES): Add strchrnul.def.
* libc/string/strings.tex: Include strchrnul and add to menu.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
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>
Fix an inconsistent use of '.' to separate function names in FUNCTION. ',' is
used everywhere else.
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdio/fread.c: Fix inconsistent use of '.' to separate
function names in FUNCTION mark up.
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>
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdio/getchar_u.c: Fix a non-ANSI prototype in SYNOPSIS.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/string/wcscpy.c: Remove stray ',' from prototype in
ANSI_SYNOPSIS.
* libc/string/wcpcpy.c: Ditto.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 Jon Turney <jon.turney@dronecode.org.uk>
* libc/signal/signal.tex: Use texinfo not makedoc markup.
* libc/stdio/stdio.tex: Ditto.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and
_UINTPTR_EQ_ULONGLONG from here...
* libc/include/sys/_intsup.h: ...to here. Rename to _INTPTR_EQ_LONG
and _INTPTR_EQ_LONGLONG to refer to signed base type. Add test for
base type of int32_t and set _INT32_EQ_LONG accordingly.
* libc/include/stdint.h: Change checks for __have_long32 to checks
for _INT32_EQ_LONG.
* libc/include/inttypes.h: Ditto. Accommodate aforementioned name
change.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This avoids a strlen(NULL) crash a few lines later.
* libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL.
Use _tzname as fallback if TM_ZONE is NULL.
2015-03-23 Joel Sherrill <joel.sherrill@oarcorp.com
* configure.in: Delete logic to determine _UINTPTR_EQ_ULONGLONG
and _UINTPTR_EQ_ULONG at configuration time.
*libc/include/sys/config.h: Add logic to determine
_UINTPTR_EQ_ULONGLONG and _UINTPTR_EQ_ULONG at compilation time.
* libc/include/inttypes.h: Add include of <sys/config.h>.
* configure: Regenerated.
If the newlib .info files are installed using install-info, 'info libc' and
'info libm' don't work.
This seems to be due to the formatting of the directory entry line not being
quite right, so fix that.
Also use @direntry texinfo command, rather than writing .info directory entry
literally.
Also use @dircategory texinfo command to place into 'Newlib' category, rather
than ending up in 'Miscellaneous'
newlib/ChangeLog:
2015-03-13 Jon TURNEY <jon.turney@dronecode.org.uk>
* libc/libc.texinfo: Fix directory entry.
* libm/libm.texinfo: Ditto.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>