summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string
Commit message (Collapse)AuthorAgeFilesLines
* newlib: string/Makefile.am (CHEWOUT_FILES): Add strnstr.defCorinna Vinschen2017-08-302-2/+2
| | | | | | Regenerate strings/Makefile.in Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* newlib: strnstr: drop traditional synopisisCorinna Vinschen2017-08-301-7/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add man page entry for strnstr.c.Sichen Zhao2017-08-302-0/+43
|
* Modify strnstr.c.Sichen Zhao2017-08-301-55/+10
|
* newlib: rebuild string/Makefile.inCorinna Vinschen2017-08-251-27/+49
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Port strnstr.c to newlib.Sichen Zhao2017-08-251-0/+1
|
* Import strnstr.c from FreeBSD.Sichen Zhao2017-08-251-0/+65
|
* Add ffsl(), ffsll(), fls(), flsl(), flsll()Sebastian Huber2017-07-057-13/+238
| | | | | | | Use compiler builtin for ffs(). Remove duplicate implementation from Cygwin. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Implement bzero() via memset()Sebastian Huber2017-07-051-8/+5
| | | | | | | Use memset() to implement bzero() to profit from machine-specific memset() optimizations. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* string: fix strverscmp doc inclusionYaakov Selkowitz2017-06-191-0/+3
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* string: add strverscmpYaakov Selkowitz2017-06-194-2/+114
| | | | | | The actual implementation is from musl (MIT license). Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* libc/string/strsignal.c: Use of || not && lead to dead code.Joel Sherrill2017-03-151-4/+2
| | | | Coverity Id: 175333
* Add missing headers to fix implicit function defnsPat Pannuto2017-01-162-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few files were missing headers for memset/malloc, likely missed because the files don't directly call the functions, rather they come in via macros in libc/include/sys/reent.h: #define _REENT_CHECK(var, what, type, size, init) do { \ struct _reent *_r = (var); \ if (_r->what == NULL) { \ _r->what = (type)malloc(size); \ #define _REENT_CHECK_ASCTIME_BUF(var) \ _REENT_CHECK(var, _asctime_buf, char *, _REENT_ASCTIME_SIZE, \ memset((var)->_asctime_buf, 0, _REENT_ASCTIME_SIZE)) Without these fixes, implicit function signatures are provided, which gcc warns could cause aliasing issues down the line: ../../../../../../../newlib-2.5.0/newlib/libc/time/asctime.c:62:3: warning: type of 'memset' does not match original declaration [-Wlto-type-mismatch] /Volumes/code/external/newlib-cygwin/newlib/libc/include/string.h:29:7: note: return value type mismatch _PTR _EXFUN(memset,(_PTR, int, size_t)); ^ /Volumes/code/external/newlib-cygwin/newlib/libc/include/string.h:29:7: note: 'memset' was previously declared here /Volumes/code/external/newlib-cygwin/newlib/libc/include/string.h:29:7: note: code may be misoptimized unless -fno-strict-aliasing is used ../../../../../../../newlib-2.5.0/newlib/libc/time/asctime.c:62:3: warning: type of 'malloc' does not match original declaration [-Wlto-type-mismatch] /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: return value type mismatch extern _PTR malloc _PARAMS ((size_t)); ^ /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: 'malloc' was previously declared here /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: code may be misoptimized unless -fno-strict-aliasing is used ../../../../../../../newlib-2.5.0/newlib/libc/time/lcltime.c:58:3: warning: type of 'malloc' does not match original declaration [-Wlto-type-mismatch] /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: return value type mismatch extern _PTR malloc _PARAMS ((size_t)); ^ /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: 'malloc' was previously declared here /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: code may be misoptimized unless -fno-strict-aliasing is used ../../../../../../../newlib-2.5.0/newlib/libc/string/strsignal.c:70:3: warning: type of 'malloc' does not match original declaration [-Wlto-type-mismatch] /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: return value type mismatch extern _PTR malloc _PARAMS ((size_t)); ^ /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: 'malloc' was previously declared here /Volumes/code/external/newlib-cygwin/newlib/libc/include/malloc.h:37:13: note: code may be misoptimized unless -fno-strict-aliasing is used Including the proper headers elminates the implicit function signatures and these warnings.
* Bump release to 2.5.0 for yearly snapshot.newlib-2_5_0Jeff Johnston2016-12-221-32/+18
|
* Fix typo in strerror doccygwin-2_6_0-releaseCorinna Vinschen2016-08-311-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* strerror_l: Fix copy-and-paste typoEric Blake2016-08-231-1/+1
| | | | Signed-off-by: Eric Blake <eblake@redhat.com>
* Mention strerror_l in libc/string/strings.texCorinna Vinschen2016-08-231-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement missing POSIX-1.2008 function strerror_lCorinna Vinschen2016-08-231-1/+18
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove extern declaration of __locale_cjk_lang in string/local.hCorinna Vinschen2016-08-211-4/+0
| | | | | | | Now that __locale_cjk_lang is an inline function in setlocale.h and setlocale.h is included, the declaration doesn't make sense. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement per-locale string functionsCorinna Vinschen2016-08-1518-52/+576
| | | | | | | | | | | | strcasecmp_l, strcoll_l, strncasecmp_l, strxfrm_l, wcscasecmp_l, wcscoll_l, wcstrncasecmp_l, wcstrxfrm_l, strftime_l. Add missing CHEWOUT_FILES from previous patch. TODO: strfmon_l. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* Regenerate newlib MakefilesJon Turney2016-07-041-3/+16
|
* Add timingsafe_memcmp()Sebastian Huber2016-03-183-18/+73
| | | | | | | | | | This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (timingsafe_memcmp): Declare. * libc/string/timingsafe_memcmp.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
* Add timingsafe_bcmp()Sebastian Huber2016-03-183-21/+58
| | | | | | | | | | This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (timingsafe_bcmp): Declare. * libc/string/timingsafe_bcmp.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
* Add explicit_bzero()Sebastian Huber2016-03-183-46/+72
| | | | | | | | | | This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (explicit_bzero): Declare. * libc/string/explicit_bzero.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
* Fix compile with GCC 5 -WerrorYaakov Selkowitz2016-02-121-1/+1
| | | | | | | | | | | newlib/libc/ * stdio64/freopen64.c: Include <string.h> for memset(). * stdlib/quick_exit.c: Include <unistd.h> for _exit(). * string/gnu_basename.c (__gnu_basename): Fix discarded const qualifier warning. * stdlib/strtold.c: Include "mprec.h" for _strtorx_r(). Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Move duplicated documentation rules to Makefile.sharedJeff Johnston2015-11-022-21/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Also, harmonize libm to use CHEWOUT_FILES like libc, rather than chobj. Update documentation appropriately. * HOWTO: Update. * Makefile.shared: Move documentation rules to here... * libc/argz/Makefile.am: ... from here ... * libc/ctype/Makefile.am: ... and here. * libc/errno/Makefile.am: Ditto. * libc/iconv/Makefile.am: Ditto. * libc/iconv/ccs/Makefile.am : Ditto. * libc/iconv/ces/Makefile.am: Ditto. * libc/iconv/lib/Makefile.am: Ditto. * libc/locale/Makefile.am: Ditto. * libc/misc/Makefile.am: Ditto. * libc/posix/Makefile.am: Ditto. * libc/reent/Makefile.am: Ditto. * libc/search/Makefile.am: Ditto. * libc/stdio/Makefile.am: Ditto. * libc/stdio64/Makefile.am: Ditto. * libc/stdlib/Makefile.am : Ditto. * libc/string/Makefile.am: Ditto. * libc/syscalls/Makefile.am: Ditto. * libc/time/Makefile.am : Ditto. * libc/unix/Makefile.am: Ditto. * libc/xdr/Makefile.am: Ditto. * libm/common/Makefile.am: Ditto. * libm/complex/Makefile.am: Ditto. * libm/math/Makefile.am: Ditto. * libm/mathfp/Makefile.am: Ditto.
* Add missing semicolons to prototypes.Jeff Johnston2015-11-022-8/+8
| | | | | | | | | | | | | * libc/stdio/fseek.c: Add missing semicolons to prototypes in SYNOPSIS. * libc/stdio/fwide.c: Ditto. * libc/stdio64/fseeko64.c: Ditto. * libc/string/strtok.c: Ditto. * libc/string/wcstok.c: Ditto. * libm/math/w_cosh.c: Ditto. * libm/math/w_fmod.c: Ditto. * libm/mathfp/s_cosh.c: Ditto. * libm/mathfp/s_fmod.c: Ditto.
* Regenerate Makefile.inJon TURNEY2015-06-291-1/+1
| | | | | | | | | | | | | | | Regenerate Makefile.in with changes in commits 153385d8 and 433aad91 2015-06-29 Jon Turney <jon.turney@dronecode.org.uk> * libc/ctype/Makefile.in: Regenerate. * libc/posix/Makefile.in: Ditto. * libc/stdio/Makefile.in: Ditto. * libc/stdio64/Makefile.in: Ditto. * libc/stdlib/Makefile.in: Ditto. * libc/string/Makefile.in: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Use source files which have makedoc markup, but aren't processed or included.newlib-snapshot-20150623Jon TURNEY2015-06-242-1/+5
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Use makedoc output files which are generated but aren't includedJon TURNEY2015-06-241-0/+8
| | | | | | | | | | | | | | | | | | | 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>
* Remove stray punctuation in ANSI_SYNOPSIS prototypesJon TURNEY2015-06-232-2/+2
| | | | | | | | | | 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>
* string: add GNU basename(3)Yaakov Selkowitz2015-04-233-2/+38
| | | | | | | | * libc/include/libgen.h (_BASENAME_DEFINED): Define. * libc/include/string.h (basename): Declare. * libc/string/Makefile.am (ELIX_4_SOURCES): Add gnu_basename.c. * libc/string/Makefile.in: Regenerate. * libc/string/gnu_basename.c: New file.
* * libc/string/memccpy.c (memccpy): Fix warning about signed-unsignedCorinna Vinschen2014-10-098-9/+15
| | | | | | | | | | | | | | | comparison * libc/string/memchr.c (memchr): Ditto. * libc/string/memrchr.c (memrchr): Ditto. * libc/string/memset.c: (memset): Ditto. * libc/string/rawmemchr.c (rawmemchr): Ditto. * libc/string/local.h (__locale_cjk_lang): Fix "function declaration isn't a prototype" warning. * libc/string/strcasestr.c (strcasestr): Ditto. * libc/string/u_strerr.c (_user_strerror): Fix "unused parameter" warnings. * libc/string/rawmemchr.c (rawmemchr): Fix comment type "// ..." -> "/* ... */".
* * libc/string/strerror.c: Fix documentation so makedoc doesn'tCorinna Vinschen2014-07-301-1/+1
| | | | stumble over a sole EAGAIN.
* * libc/include/sys/errno.h: Fix comments.Corinna Vinschen2014-07-141-17/+74
| | | | | | * libc/string/strerror.c: Fix documentation. (_strerror_r): Handle ENETRESET, EILSEQ, ENODATA, ECONNRESET, EADDRNOTAVAIL, EOVERFLOW. Fix strings for EMFILE and EDOM.
* 2013-12-10 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2013-12-103-0/+19
| | | | | | | | | | | | * acconfig.h: Add _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL. * newlib.hin: Ditto. * configure: Regenerate. * configure.in: Add setting of _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL. * libc/string/local.h: Add check for _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL and set __inhibit_loop_to_libcall macro appropriately. * libc/string/memmove.c: Use __inhibit_loop_to_libcall macro in function declaration. * libc/string/memset.c: Ditto.
* 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com>Joel Sherrill2013-11-2610-52/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *libc/include/wchar.h: Add restrict keyword. *libc/stdio/fgetws.c (fgetws): ditto. *libc/stdio/fputws.c (fputws): ditto. *libc/stdio/fwprintf.c (fwprintf): ditto. *libc/stdio/fwscanf.c (fwscanf): ditto. *libc/stdio/swprintf.c (swprintf): ditto. *libc/stdio/swscanf.c (swscanf): ditto. *libc/stdio/vfwprintf.c (vfwprintf): ditto. *libc/stdio/vfwscanf.c (vfwscanf): ditto. *libc/stdio/vswprintf.c (vswprintf): ditto. *libc/stdio/vswscanf.c (vswscanf): ditto. *libc/stdio/vwprintf.c (vwprintf): ditto. *libc/stdio/vwscanf.c (vwscanf): ditto. *libc/stdio/wprintf.c (wprintf): ditto. *libc/stdio/wscanf.c (wscanf): ditto. *libc/stdlib/mbrlen.c (mbrlen): ditto. *libc/stdlib/mbrtowc.c (mbrtowc): ditto. *libc/stdlib/mbsnrtowcs.c (mbsnrtowcs): ditto. *libc/stdlib/mbsrtowcs.c (mbsrtowcs): ditto. *libc/stdlib/wcrtomb.c (wcrtomb): ditto. *libc/stdlib/wcsnrtombs.c (wcsnrtombs): ditto. *libc/stdlib/wcsrtombs.c (wcsrtombs): ditto. *libc/stdlib/wcstod.c (wcstod): ditto. *libc/stdlib/wcstol.c (wcstol): ditto. *libc/stdlib/wcstold.c (wcstold): ditto. *libc/stdlib/wcstoll.c (wcstoll): ditto. *libc/stdlib/wcstoul.c (wcstoul): ditto. *libc/stdlib/wcstoull.c (cstoull): ditto. *libc/string/wcpcpy.c (wcpcpy): ditto. *libc/string/wcpncpy.c (wcpncpy): ditto. *libc/string/wcscat.c (wcscat): ditto. *libc/string/wcscpy.c (wcscpy): ditto. *libc/string/wcsncat.c (wcsncat): ditto. *libc/string/wcsncpy.c (wcsncpy): ditto. *libc/string/wcsstr.c (wcsstr): ditto. *libc/string/wcstok.c (wcstok): ditto. *libc/string/wcsxfrm.c (wcsxfrm): ditto. *libc/string/wmemcpy.c (wmemcpy): ditto.
* 2013-08-08 Freddie Chopin <freddie_chopin@op.pl>Joel Sherrill2013-08-081-1/+1
| | | | * libc/string/strncat.c: Fix typo in documentation.
* * libc/sys/linux/include/netdb.h, libc/sys/linux/net/getaddrinfo.c,Corinna Vinschen2013-07-2310-32/+39
| | | | | | | | | | | | | libc/sys/linux/net/getnameinfo.c: Add restrict keyword to getnameinfo() and getaddrinfo() to increase standards compliance and match glibc. * libc/include/string.h, libc/string/memccpy.c, libc/string/memcpy.c, libc/string/stpcpy.c, libc/string/stpncpy.c, libc/string/strcat.c, libc/string/strncat.c, libc/string/strncpy.c, libc/string/strtok.c, libc/string/strtok_r.c, libc/string/strxfrm.c libc/machine/microblaze/strcpy.c, libc/machine/xscale/memcpy.c, libc/machine/cris/memcpy.c: Add __restrict to prototype to increase standards compliance.
* * libc/include/string.h (rawmemchr): Declare.Yaakov Selkowitz2013-06-243-2/+133
| | | | | | | * libc/string/Makefile.am (ELIX_4_SOURCES): Add rawmemchr.c. (CHEWOUT_FILES): Add rawmemchr.def. * libc/string/Makefile.in: Regenerate. * libc/string/rawmemchr.c: New file.
* 2013-04-29 Sebastian Huber <sebastian.huber@embedded-brains.de>Jeff Johnston2013-04-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libc/stdio/local.h (CHECK_INIT): Evaluate argument only once. (CHECK_STD_INIT): Likewise. * libc/stdio/fgetc.c (fgetc): Use local variable for _REENT. * libc/stdio/fgetwc.c (fwgetc): Likewise. * libc/stdio/fgetws.c (fgetws): Likewise. * libc/stdio/fputc.c (fputc): Likewise. * libc/stdio/fputwc.c (fputwc): Likewise. * libc/stdio/fputws.c (fputws): Likewise. * libc/stdio/getc.c (getc): Likewise. * libc/stdio/getchar.c (_getchar_r): Likewise. * libc/stdio/putc.c (putc): Likewise. * libc/stdio/putchar.c (putchar): Likewise. * libc/stdio/scanf.c (scanf): Likewise. * libc/stdio/setvbuf.c (setvbuf): Likewise. * libc/stdio/ungetwc.c (ungetwc): Likewise. * libc/stdio/vfscanf.c (VFSCANF): Likewise. * libc/stdio/vfwscanf.c (VFWSCANF): Likewise. * libc/stdio/viprintf.c (viprintf): Likewise. * libc/stdio/viscanf.c (viscanf): Likewise. * libc/stdio/vprintf.c (vprintf): Likewise. * libc/stdio/vscanf.c (vscanf): Likewise. * libc/stdio/vwprintf.c (vwprintf): Likewise. * libc/stdio/vwscanf.c (vwscanf): Likewise. * libc/stdio/wscanf.c (wscanf): Likewise. * libc/stdlib/ecvtbuf.c (fcvtbuf): Likewise. (fcvtbuf): Likewise. (ecvtbuf): Likewise. (ecvtbuf): Likewise. * libc/stdlib/mblen.c (mblen): Likewise. * libc/stdlib/mbrlen.c (mbrlen): Likewise. * libc/stdlib/mbrtowc.c (mbrtowc): Likewise. * libc/stdlib/mbtowc.c (mbtowc): Likewise. * libc/stdlib/rand.c (srand): Likewise. (rand): Likewise. * libc/stdlib/wcrtomb.c (wcrtomb): Likewise. * libc/stdlib/wctob.c (wctob): Likewise. * libc/stdlib/wctomb.c (wctomb): Likewise. * libc/string/strtok.c (strtok): Likewise. * libc/time/asctime.c (asctime): Likewise. * libc/time/gmtime.c (gmtime): Likewise. * libc/time/lcltime.c (lcltime): Likewise.
* 2012-12-20 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2012-12-201-9/+37
| | | | | | | | | | | | | | | | | | * NEWS: Update with 2.0.0 info. * README: Ditto. * acinclude.m4: Change version number to 2.0.0. * aclocal.m4: Regenerated. * configure: Ditto. * Makefile.in: Regenerated. * doc/aclocal.m4: Ditto. * doc/configure: Ditto. * libc/*/aclocal.m4: Ditto. * libc/*/configure: Ditto. * libc/libc.texinfo: Ditto. * libm/*/aclocal.m4: Ditto. * libm/*/configure: Ditto. * libm/libm.texinfo: Ditto. * libc/sys/linux/shared.ld: Add VERS_2.0
* * libc/include/sys/features.h (__GNUC_PREREQ): Define. UseCorinna Vinschen2012-10-161-2/+1
| | | | | | | throughout in place of explicit GNUC version checks. * libc/include/_ansi.h (_NOINLINE): Define. (_NOINLINE_STATIC): Define. * libc/stdio/vfprintf.c (__sbprintf): Define _NOINLINE_STATIC.
* * libc/posix/engine.c(dissect): Guard diagnostic pragma for rightCorinna Vinschen2012-08-081-0/+3
| | | | | | | versions of GCC only. * libc/string/strcasestr.c: Ditto. Fix typo in previous ChangeLog entry.
* Throughout, run newlib with -Wall -Werror option and fix bugs andCorinna Vinschen2012-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/include/string.h (memrchr): Declare.Corinna Vinschen2012-05-103-2/+146
| | | | | | | * libc/string/Makefile.am (ELIX_4_SOURCES): Add memrchr.c. (CHEWOUT_FILES): Add memrchr.def. * libc/string/Makefile.in: Regenerate. * libc/string/memrchr.c: New file.
* 2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius2011-08-237-12/+12
| | | | | | | * libc/misc/ffs.c, libc/string/bcmp.c, libc/string/bcopy.c, libc/string/bzero.c, libc/string/index.c, libc/string/rindex.c, libc/string/strcasecmp.c, libc/string/strncasecmp.c: Let synopsis reference "#include <strings.h>".
* 2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius2011-08-231-0/+3
| | | | | | | * libc/posix/regexec.c: Define "nope" only #ifndef NDEBUG. * libc/stdio/vfscanf.c: Define "state" only #ifdef _MB_CAPABLE. * libc/string/wcwidth.c: Include <wctypes.h> for "iswprint" and "iswcntrl".
* 2011-08-22 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius2011-08-225-3/+5
| | | | | | | | | | | | | * libc/string/index.c: Include <strings.h> for "index". * libc/string/rindex.c: Include <strings.h> for "rindex". * libc/string/strcasecmp.c: Include <strings.h> for "strcasecmp". Don't include <string.h>. * libc/string/strncasecmp.c: Include <strings.h> for "strncasecmp". Don't include <string.h>. * libc/string/bzero.c: Include <strings.h> for "bzero". Don't include <string.h> * libc/misc/ffs.c: Include <strings.h> for "ffs". Don't include <_ansi.h>.
* 2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius2011-08-193-0/+3
| | | | | | | * libc/string/bcmp.c: Include <strings.h> for "bcmp". * libc/string/bcopy.c: Include <strings.h> for "bcopy". * libc/string/strcasestr.c: Include <strings.h> for "strncasecmp". * libc/time/strptime.c: Include <strings.h> for "strncasecmp".