Commit Graph

304 Commits

Author SHA1 Message Date
Jeff Johnston d34336767e 2014-07-04 Bin Cheng <bin.cheng@arm.com>
* README (--enable-newlib-nano-formatted-io): Describe.
        * acconfig.h (_NANO_FORMATTED_IO): Undef.
        * newlib.hin (_NANO_FORMATTED_IO): Undef.
        * configure.in (--enable-newlib-nano-formatted-io): New option.
        * configure: Regenerated.
        * libc/configure.in (--enable-newlib-nano-formatted-io): New option.
        * libc/configure: Regenerated.
        * libc/stdio/Makefile.am (NEWLIB_NANO_FORMATTED_IO): Support new
        configuration option.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/asnprintf.c (_asniprintf_r, asniprintf): Use
        _NANO_FORMATTED_IO to declare alias prototypes.
        * libc/stdio/asprintf.c (_asiprintf_r, asiprintf): Ditto.
        * libc/stdio/dprintf.c (_diprintf_r, diprintf): Ditto.
        * libc/stdio/fprintf.c (_fiprintf_r, fiprintf): Ditto.
        * libc/stdio/fscanf.c (fiscanf, _fiscanf_r): Ditto.
        * libc/stdio/printf.c (_iprintf_r, iprintf): Ditto.
        * libc/stdio/scanf.c (iscanf, _iscanf_r): Ditto.
        * libc/stdio/snprintf.c (_sniprintf_r, sniprintf): Ditto.
        * libc/stdio/sprintf.c (_siprintf_r, siprintf): Ditto.
        * libc/stdio/sscanf.c (siscanf, _siscanf_r): Ditto.
        * libc/stdio/vasnprintf.c (_vasniprintf_r, vasniprintf): Ditto.
        * libc/stdio/vasprintf.c (vasiprintf, _vasiprintf_r): Ditto.
        * libc/stdio/vdprintf.c (_vdiprintf_r, vdiprintf): Ditto.
        * libc/stdio/vprintf.c (viprintf, _viprintf_r): Ditto.
        * libc/stdio/vscanf.c (viscanf, _viscanf_r): Ditto.
        * libc/stdio/vsnprintf.c (vsniprintf, _vsniprintf_r): Ditto.
        * libc/stdio/vsprintf.c (vsiprintf, _vsiprintf_r): Ditto.
        * libc/stdio/vsscanf.c (vsiscanf, _vsiscanf_r): Ditto.
        * libc/stdio/nano-vfprintf.c: New file.
        * libc/stdio/nano-vfprintf_float.c: New file.
        * libc/stdio/nano-vfprintf_i.c: New file.
        * libc/stdio/nano-vfprintf_local.h: New file.
        * libc/stdio/nano-vfscanf.c: New file.
        * libc/stdio/nano-vfscanf_float.c: New file.
        * libc/stdio/nano-vfscanf_i.c: New file.
        * libc/stdio/nano-vfscanf_local.h: New file.
2014-07-04 17:21:45 +00:00
Jeff Johnston d3925b72d5 2014-04-04 Ashish Kapania <akapania@ti.com>
* configure.host (sys_dir, newlib_cflags): Set sys_dir to tirtos and use
        -D__DYNAMIC_REENT__ and -DMALLOC_PROVIDED compiler options for TIRTOS
        target.
        * libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Change #ifdef
        to not define this macro when __tirtos__ is defined.
        * libc/sys/tirtos : Add support for TIRTOS.
        * libc/sys/tirtos/Makefile.am, libc/sys/tirtos/lock.c: New files.
        * libc/sys/tirtos/configure.in, libc/sys/tirtos/include/sys/lock.h: Ditto.
2014-04-04 21:40:59 +00:00
Corinna Vinschen 23c0f21594 * libc/stdio/open_memstream.c (internal_open_memstream_r): Initialize
c->pos to 0.
2014-02-20 13:32:34 +00:00
Corinna Vinschen 7a7e4d4d95 Introduce _STDIO_BSD_SEMANTICS flag to switch fclose/exit file flushing
semantics from POSIX to BSD.
	* libc/stdio/fclose.c (_fclose_r): Conditionalize file flushing on
	_STDIO_BSD_SEMANTICS.  Call __sflush_r rather than _fflush_r.  Add
	comment.
	* libc/stdio/fflush.c (__sflushw_r): New function, only available
	if _STDIO_BSD_SEMANTICS is defined.
	* libc/stdio/findfp.c (_cleanup_r): Call _fwalk_reent rather than
	_fwalk.  Conditionalize cleanup function call on _STDIO_BSD_SEMANTICS.
	Add comments.  Add FIXME.
	* libc/stdio/local.h (__sflushw_r): Declare if _STDIO_BSD_SEMANTICS is
	defined.
2014-01-17 10:55:32 +00:00
Corinna Vinschen 281924766d * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point in
!_MB_CAPABLE as well as in !__HAVE_LOCALE_INFO_EXTENDED__ case.
2013-12-19 18:50:00 +00:00
Corinna Vinschen 576b7804d6 * vfscanf.c (BUF): Change definition to take multibyte decimal point
into account.
	(__SVFSCANF_R): Handle radix char language-dependent
	per POSIX.
	(__SVFWSCANF_R): Ditto.
2013-12-18 19:23:33 +00:00
Joel Sherrill 380c9f6165 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com>
*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-11-26 17:21:01 +00:00
Joel Sherrill 481cb456a4 2013-11-18 Sahil Patnayakuni <sahilp@oarcorp.com>
* libc/include/stdio.h, libc/machine/powerpc/vfscanf.c,
	libc/machine/spu/fgetpos.c, libc/machine/spu/fgets.c,
	libc/machine/spu/fopen.c, libc/machine/spu/fputs.c,
	libc/machine/spu/fread.c, libc/machine/spu/freopen.c,
	libc/machine/spu/fwrite.c, libc/machine/spu/setbuf.c,
	libc/machine/spu/vfprintf.c, libc/machine/spu/vfscanf.c,
	libc/machine/spu/vsnprintf.c, libc/machine/spu/vsprintf.c,
	libc/machine/spu/vsscanf.c, libc/stdio/asnprintf.c,
	libc/stdio/asprintf.c, libc/stdio/dprintf.c,
	libc/stdio/fgetpos.c, libc/stdio/fgets.c,
	libc/stdio/fmemopen.c, libc/stdio/fopen.c,
	libc/stdio/fprintf.c, libc/stdio/fputs.c,
	libc/stdio/fread.c, libc/stdio/freopen.c,
	libc/stdio/fscanf.c, libc/stdio/fwrite.c,
	libc/stdio/printf.c, libc/stdio/scanf.c,
	libc/stdio/setbuf.c, libc/stdio/snprintf.c,
	libc/stdio/sprintf.c, libc/stdio/sscanf.c,
	libc/stdio/vdprintf.c, libc/stdio/vprintf.c,
	libc/stdio/vscanf.c, libc/stdio/vsnprintf.c,
	libc/stdio/vsprintf.c, libc/stdio/vsscanf.c: Add restrict keyword.
2013-11-18 17:28:06 +00:00
Corinna Vinschen 2a98b3363e * libc/stdio/fvwrite.c: Allow writing in larger chunks for fully
buffered and unbuffered files, to improve write performance.
2013-11-04 14:18:44 +00:00
Corinna Vinschen a5f316d8cf * libc/stdio/fvwrite.h: change type of uio_resid from int to size_t to
fix fwrite() of > 2GByte buffers.
2013-10-31 10:35:54 +00:00
Corinna Vinschen 0c3d8e5ab5 * libc/include/stdio.h (funopen): Change prototype of
__readfn and __writefn parameter to match new definition of
	FILE's _read and _write methods.
	(_funopen_r): Ditto.
	(funopen): Ditto.
	(_funopen_r): Ditto.
	* libc/include/sys/config.h (_READ_WRITE_BUFSIZE_TYPE) Define
	as type int if not already defined.  Add comment to explain.
	* libc/include/sys/reent.h: Include stddef.h.
	(struct __sFILE): Change type of last parameter in declaration
	of _read and _write methods to _READ_WRITE_BUFSIZE_TYPE.
	(struct __sFILE64): Ditto.
	* libc/stdio/local.h (__sread): Declare with last parameter set
	to _READ_WRITE_BUFSIZE_TYPE.
	(__seofread): Ditto.
	(__swrite): Ditto.
	(__swrite64): Ditto.
	* libc/stdio/fvwrite.c (__sfvwrite_r): Change type of local
	variables w and s to _READ_WRITE_RETURN_TYPE.
	* libc/stdio/fflush.c (__sflush_r): Change type of local variables
	n and t to _READ_WRITE_BUFSIZE_TYPE and _READ_WRITE_RETURN_TYPE.
	Add local variables flags to keep _flags value.
	* libc/stdio/fmemopen.c (fmemreader): Align to above change.
	(fmemwriter): Ditto.
	* libc/stdio/fopencookie.c (fcreader): Ditto.
	(fcwriter): Ditto.
	* libc/stdio/funopen.c (funread): Ditto.
	(funwrite): Ditto.
	(funreader): Ditto.
	(funwriter): Ditto.
	* libc/stdio/open_memstream.c (memwriter): Ditto.
	* libc/stdio/stdio.c (__sread): Ditto.
	(__seofread): Ditto.
	(__swrite): Ditto.
	* libc/stdio64/stdio64.c (__swrite64): Ditto.
2013-10-23 10:04:43 +00:00
Corinna Vinschen 56d5fc7cda * libc/configure.in (--enable-newlib-wchar-orient): Remove.
* libc/configure: Regenerated.
	* libc/stdio/Makefile.am (NEWLIB_WIDE_ORIENT): Remove.
	* libc/stdio/Makefile.in: Regenerated.
2013-08-12 11:31:53 +00:00
Corinna Vinschen 5dad9defd0 * libc/stdio/fwalk.c (_fwalk): Remove redundant test. 2013-07-09 13:07:16 +00:00
Corinna Vinschen 82c19d335a * acconfig.h (_UNBUF_STREAM_OPT): Undefine.
* newlib.hin (_UNBUF_STREAM_OPT): Undefine.
	* configure.in (--enable-newlib-unbuf-stream-opt): New option.
	* configure: Regenerate.
	* libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on
	unbuffered stream files.
	* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise.
	* README: Add description about the option.
	* newlib.hin (_UNBUF_STREAM_OPT): Undefine.
	* configure.in (--enable-newlib-unbuf-stream-opt): New option.
	* configure: Regenerate.
	* libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on
	unbuffered stream files.
	* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise.
	* README: Add description about the option.
2013-06-19 15:58:50 +00:00
Jeff Johnston b334e6660a 2013-04-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
* 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.
2013-04-29 21:06:23 +00:00
Joel Sherrill 7881a70fad 2013-04-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): New define.
	* libc/stdio/findfp.c (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Use define.
2013-04-25 15:29:19 +00:00
Corinna Vinschen f7a4b388b0 * acconfig.h (_WCHAR_ORIENT): Undef
* newlib.hin (_WCHAR_ORIENT): Undef
	* configure.in (--enable-newlib-wchar-orient): New option.
	* configure: Regenerated.
	* libc/configure.in (--enable-newlib-wchar-orient): New option.
	* libc/configure: Regenerated.
	* libc/stdio/Makefile.am (NEWLIB_WIDE_ORIENT): Use.
	* libc/stdio/Makefile.in: Regenerated.
	* libc/stdio/local.h (ORIENT): Use _WCHAR_ORIENT to control
	the definition. Add alternative definition.
	* libc/stdio/vfprintf.c (__sfputs_r, __sprint_r): Use _WCHAR_ORIENT
	to control the wide char output.
2013-04-12 12:05:31 +00:00
Jeff Johnston 602cec7f1e 2013-04-10 Bin Cheng <bin.cheng@arm.com>
* acconfig.h (_FSEEK_OPTIMIZATION): Undef
        * newlib.hin (_FSEEK_OPTIMIZATION): Undef
        * configure.in (--disable-newlib-fseek-optimization): New option.
        * configure: Regenerated.
        * libc/stdio/fflush.c (__sflush_r): Use _FSEEK_OPTIMIZATION to
        control fseek optimization.
        * libc/stdio/fseeko.c (_fseeko_r): Ditto.
        * libc/stdio/makebuf.c (__smakebuf_r): Ditto.
        * libc/stdio64/fseeko64.c (_fseeko64_r): Ditto.
2013-04-10 18:47:46 +00:00
Matthew Gretton-Dann d57416f03d * libc/stdio/vfieeefp.h (ldieee): Fix typo. 2013-04-08 09:34:35 +00:00
Corinna Vinschen 409c27f834 * acconfig.h (_FVWRITE_IN_STREAMIO): Undefine.
* newlib.hin (_FVWRITE_IN_STREAMIO): Undefine.
	* configure.in (--disable-newlib-fvwrite-in-streamio): New option.
	* configure: Regenerated.
	* libc/stdio/fputs.c (_fputs_r): Use _FVWRITE_IN_STREAMIO to
	control __sfvwrite_r.  Add alternative implementation.
	* libc/stdio/fputws.c (_fputws_r): Ditto.
	* libc/stdio/fwrite.c (_fwrite_r): Ditto.
	* libc/stdio/puts.c (_puts_r): Ditto.
	* libc/stdio/vfprintf.c (__ssputs_r, __sfputs_r): New function.
	(_VFPRINTF_R): Use _FVWRITE_IN_STREAMIO to control vector buffer.
	(__SPRINT): Use _FVWRITE_IN_STREAMIO to control macro definition.
	* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Use _FVWRITE_IN_STREAMIO
	to control vector buffer.
2013-03-27 09:38:39 +00:00
Joel Sherrill 1ebc8da242 2013-03-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/stdio/local.h (_STDIO_WITH_THREAD_CANCELLATION_SUPPORT):
	New define.
	* libc/stdio/fclose.c: Use
	_STDIO_WITH_THREAD_CANCELLATION_SUPPORT.
	* libc/stdio/freopen.c: Likewise.
	* libc/stdio64/freopen64.c: Likewise.
2013-03-26 16:07:55 +00:00
Corinna Vinschen 01aff1ea37 * newlib/libc/stdio/findfp.c (glue_with_file): New.
(__sfmoreglue): Use glue_with_file to avoid alignment problems.
2013-03-15 13:19:29 +00:00
Corinna Vinschen 3920a99a22 * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Add code to correctly handle
's' format specifier on not _MB_CAPABLE targets.  Fix a formatting
	glitch in _MB_CAPABLE enabled code.  Add a missing 'L' specifier.
2013-01-11 20:05:41 +00:00
Jeff Johnston f2d223bd0f 2012-12-20 Jeff Johnston <jjohnstn@redhat.com>
* 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
2012-12-20 21:10:27 +00:00
Corinna Vinschen e3132dba59 * libc/stdio/puts.c (_puts_r): Fix typo in previous patch. Add local
variable fp for better readability.
2012-12-18 08:54:10 +00:00
Jeff Johnston 0a95d80385 2012-12-17 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/puts.c: Add fp locking and use _stdout_r macro
        to refer to the stream rather than stdout.
2012-12-17 22:44:09 +00:00
Corinna Vinschen 0772f3f1c1 * libc/include/sys/reent.h (__sFILE): Change type of _offset
from int to _off_t.
	* libc/stdio/ftell.c: Use _ftello_r().
	* libc/stdio/ftello.c: Copy implementation from previous
	_ftell_r().
	* libc/stdio/fseek.c: Use _fseeko_r().
	* libc/stdio/fseeko.c: Copy implementation from previous
	_fseek_r().
2012-11-29 16:28:30 +00:00
Corinna Vinschen 1772168778 * libc/stdio/vfprintf.c (__sbprintf): Fix comment. 2012-10-16 19:03:01 +00:00
Corinna Vinschen 5eceb3958e * libc/include/sys/features.h (__GNUC_PREREQ): Define. Use
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.
2012-10-16 18:45:24 +00:00
Christopher Faylor 918ed39f09 * libc/stdio/flags.c (__sflags): Guard against using O_BINARY on systems which
do not provide it.
2012-08-23 04:19:59 +00:00
Christopher Faylor 03f6bb2863 * libc/stdio/flags.c (__sflags): Rewrite recognition of extended mode flags to
just loop over more allowed flags.  Support glibc 'e' flag on systems defining
_GLIBC_EXTENSION.  Support C11 'x' flag.
2012-08-21 14:51:50 +00:00
Corinna Vinschen b2bde18ba5 * libc/stdlib/btowc.c (btowc): Cast to avoid compiler warning.
* libc/search/hash_buf.c (__get_buf): Initialize local vars to avoid
	compiler warning.
	* libc/stdio/fgets.c (_fgets_r): Ditto.
	* libc/time/strftime.c (strftime): Ditto.
2012-08-10 15:21:57 +00:00
Corinna Vinschen c9ace3130c * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Fix guard around state to
allow usage in !FLOATING_POINT && _WANT_IO_C99_FORMATS case.
2012-08-10 09:37:32 +00:00
Corinna Vinschen 1f232abc89 Throughout, run newlib with -Wall -Werror option and fix bugs and
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.
2012-08-08 11:04:18 +00:00
Corinna Vinschen 821c8b9aac * libc/stdio/fileno.c (fileno): Check if f is a valid stream. If not,
return -1 and set errno to EBADF per POSIX.
2012-07-09 12:13:16 +00:00
Corinna Vinschen 8336af85e9 * libc/stdio/findfp.c (__sinit): Avoid infinite recursion on
_REENT_SMALL targets.  Add comment to explain.
2012-06-05 16:17:16 +00:00
Corinna Vinschen 94c837599c * libc/stdio/local.h (_newlib_sfp_lock_exit): Fix typo in non-pthread
version.
2012-05-31 07:33:59 +00:00
Corinna Vinschen 53bbfeed98 * libc/stdio/fgetws.c (_fgetws_r): Call _mbsnrtowcs_r rather than
_mbsrtowcs_r and restrict number of wide chars to n - 1.
2012-05-30 14:42:52 +00:00
Corinna Vinschen 4aa28d8ae2 * libc/stdio/local.h (_newlib_flockfile_start): New macro to
secure stream related critical section against thread cancellation.
	(_newlib_flockfile_exit): Ditto.
	(_newlib_sfp_lock_end): Ditto.
	(_newlib_sfp_lock_start): Ditto for the list of streams.
	(_newlib_sfp_lock_exit): Ditto.
	(_newlib_sfp_lock_end): Ditto.
	Use aforementioned macros in place of _flockfile/_funlockfile
	and __sfp_lock_acquire/__sfp_lock_release throughout the code.
	* libc/stdio/fclose.c: Explicitely disable and re-enable thread
	cancellation.  Explain why.
	* libc/stdio/freopen.c: Ditto.
	* libc/stdio64/freopen64.c: Ditto.
2012-05-30 08:58:42 +00:00
Corinna Vinschen 33c789303f * libc/stdio/findfp.c (__sinit): Set __sdidinit last. 2012-03-26 10:43:06 +00:00
Yaakov Selkowitz 29d84e5a46 * libc/stdio/sprintf.c: Document 'm' conversion specifier.
* libc/stdio/swprintf.c: Ditto.
	* libc/stdio/vfprintf.c (_VFPRINTF_R) [_GLIBC_EXTENSION]: Handle 'm'
	conversion specifier.
	* libc/stdio/vfwprintf.c (_VFWPRINTF_R) [_GLIBC_EXTENSION]: Ditto.
2012-01-13 09:13:57 +00:00
Corinna Vinschen 87865f4c9a * fvwrite.c (__sfvwrite_r): Set __SMBF flag to avoid double free in
fclose.  Enhance comment.
2011-12-20 09:06:58 +00:00
Jeff Johnston e7c65aae83 2011-12-19 Jeff Johnston <jjohnstn@redhat.com>
* NEWS: Update with 1.20.0 info.
        * README: Ditto.
        * acinclude.m4: Change version number to 1.20.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_1.20
2011-12-19 22:03:51 +00:00
Ralf Corsepius 0792b19670 2011-08-23 Ralf Corsépius <ralf.corsepius@rtems.org>
* 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-23 11:59:56 +00:00
Ralf Corsepius 34dc27f95d 2011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/stdio/vasiprintf.c: Include "local.h" for "_svfiprintf_r".
	* libc/stdio/vasprintf.c Include "local.h" for "_svfprintf_r".
	* libc/stdio/vsiprintf.c: Include "local.h" for "_svfiprintf_r".
	* libc/stdio/vsniprintf.c: Include "local.h" for "_svfiprintf_r".
	* libc/stdio/vsnprintf.c: Include "local.h" for "_svfprintf_r"
	* libc/stdio/vsprintf.c: Include "local.h" for "_svfprintf_r"
2011-08-19 17:00:32 +00:00
Jeff Johnston 7890be6e7d 2011-07-15 Yufeng Zhang <yufeng.zhang@arm.com>
* libc/stdio/vfwprintf.c (wcvt): Add a new parameter len of type
        int.  *length is set to the value of (rev - digits) regardless
        of whether _MB_CAPABLE is defined or not.  Replace BUF with len
        in calling _mbsnrtowcs_r and also in the loop where _MB_CAPABLE
        is not defined.
        (_VFWPRINTF_R): Call wcvt with an extra argument.  Call wcvt
        again with allocated new buffer if buf is not large enough for
        the conversion.
        * testsuite/newlib.stdio/stdio.exp: New.
        * testsuite/newlib.stdio/swprintf.c: Likewise.
2011-07-15 17:20:16 +00:00
Corinna Vinschen c842ff73e7 * libc/stdio/fscanf.c (fscanf): Call _vfscanf_r instead of __svfscanf_r
to make sure CHECK_INIT is called.
	(_fscanf_r): Ditto.
	* /libc/stdio/scanf.c (scanf): Ditto.
	(_scanf_r): Ditto.
	* libc/stdio/fwscanf.c (fwscanf): Call _vfwscanf_r instead of
	__svfwscanf_r to make sure CHECK_INIT is called.
	(_fwscanf_r): Ditto.
	* libc/stdio/wscanf.c (wscanf): Ditto.
	(_wscanf_r): Ditto.
2011-07-15 08:04:17 +00:00
Eric Blake 4226571d7a printf: set errno for read-only stream
* libc/stdio/wsetup.c (__swsetup_r): Set errno on failure.
* libc/stdio/fvwrite.c (__sfvwrite_r): Simplify.
* libc/stdio/wbuf.c (__swbuf_r): Likewise.
* libc/stdio/local.h (cantwrite): Adjust comment.
2011-06-14 03:56:05 +00:00
Eric Blake 4805b60ccf strerror: allow user hook to comply with POSIX rules
* libc/string/strerror.c (strerror): Split body into...
(_strerror_r): ...new reentrant function.
* libc/string/u_strerr.c (_user_strerror): Update signature.
* libc/include/stdio.h (_strerror_r): New prototype.
* libc/posix/collate.c (__collate_err): Adjust callers.
* libc/stdio/perror.c (_perror_r): Likewise.
* libc/string/strerror_r.c (strerror_r): Likewise.
* libc/string/xpg_strerror_r.c (__xpg_strerror_r): Likewise.
2011-05-25 18:41:10 +00:00
Yaakov Selkowitz 831826db94 * libc/include/stdio_ext.h: New header.
* libc/stdio/fpurge.c [!__rtems__] (__fpurge): New function.
2011-05-19 07:21:42 +00:00