Commit Graph

19 Commits

Author SHA1 Message Date
Yaakov Selkowitz 9087163804 ansification: remove _DEFUN
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:26 -06:00
Yaakov Selkowitz 6783860a2e ansification: remove _AND
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:05 -06:00
Yaakov Selkowitz c7ef9668cf stdio: remove TRAD_SYNOPSIS
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-12-01 03:41:51 -06: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
Eric Blake 8092f46770 Add mkostemp and mkostemps.
* libc/stdio/mktemp.c (_gettemp): Add parameter, all callers
changed.
(mkostemp, _mkostemp_r, mkostemps, _mkostemps_r): New interfaces,
for ELIX level 4.
* libc/include/stdlib.h (mktemp): Avoid namespace issues.
(mkostemp, mkostemps): Declare.
2010-07-19 18:21:11 +00:00
Jeff Johnston c11ba63d52 2009-08-21 Craig Howland <howland@LGSInnovations.com>
* libm/common/s_remquo.c (remquo):  Fix sign of quotient when |x|==|y|.
        * libc/stdio/mktemp.c:  Add #include <stdlib.h> for function prototypes.
2009-08-21 20:25:28 +00:00
Corinna Vinschen 61189f19de * libc/stdio/mktemp.c (mkdtemp): Fix type in function name. 2009-08-13 07:19:33 +00:00
Jeff Johnston 12387ab6f7 2009=08-12 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/mktemp.c (_gettemp): Do not call _mkdir_r unless
        HAVE_MKDIR is defined.

2009-08-12  Hans-Peter Nilsson  <hp@axis.com>

        * libc/include/reent.h: Add prototype and definition of _mkdir_r.
        * libc/reent/Makefile.am (GENERAL_SOURCES): Add mkdirr.c.
        (CHEWOUT_FILES): Add mkdirr.def.
        * libc/reent/Makefile.in: Regenerate.
        * libc/reent/mkdirr.c: New file.
2009-08-12 18:22:38 +00:00
Eric Blake c52ac05c3a Add mkdtemp, mkstemps.
* libc/stdio/mktemp.c: Fix documentation.
(_gettemp): Add domkdir and length parameters.  Check for
insufficient 'X' suffix.  Drop cygwin-specific code.
(_mkstemp_r, _mktemp_r, mkstemp, mktemp): Adjust clients.
(_mkdtemp_r, _mkstemps_r, mkdtemp, mkstemps): New functions.
* libc/include/stdlib.h (_mkdtemp_r, _mkstemps_r, mkdtemp)
(mkstemps): Declare them.
2009-07-03 12:03:25 +00:00
Corinna Vinschen 71675a3908 * libc/include/stdio.h (_mkstemp_r, _mktemp_r): Move declarations
to stdlib.h.
	* libc/include/stdlib.h (mktemp, _mktemp_r): Warn when using.
	* libc/stdio/mktemp.c: Explain the security risk when using
	mktemp.
2009-03-14 12:14:08 +00:00
Eric Blake b4f095585f * libc/stdio64/local64.h: Delete, move contents to...
* libc/stdio/local.h: ...here.
	* libc/stdio64/fdopen64.c: Update includes.
	* libc/stdio64/fopen64.c: Likewise.
	* libc/stdio64/freopen64.c: Likewise.
	* libc/stdio64/fseeko64.c: Likewise.
	* libc/stdio64/ftello64.c: Likewise.
	* libc/stdio/findfp.c (std) [__LARGE64_FILES]: Open stdin, stdout,
	and stderr with 64-bit offset.
	* libc/stdio/fseek.c (_fseek_r): Avoid compile warning.
	* libc/stdio/makebuf.c (__smakebuf_r): Likewise.
	* libc/stdio/mktemp.c (_gettemp): Likewise.
2007-05-01 23:03:36 +00:00
Jeff Johnston 05b315770a 2004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* libc/stdio/asprintf.c libc/stdio/clearerr.c,
        libc/stdio/fclose.c libc/stdio/fcloseall.c libc/stdio/fdopen.c,
        libc/stdio/feof.c libc/stdio/ferror.c libc/stdio/fflush.c,
        libc/stdio/fgetc.c libc/stdio/fgetpos.c libc/stdio/fgets.c,
        libc/stdio/fileno.c libc/stdio/findfp.c libc/stdio/fiprintf.c,
        libc/stdio/flags.c libc/stdio/fopen.c libc/stdio/fprintf.c,
        libc/stdio/fputc.c libc/stdio/fputs.c libc/stdio/fread.c,
        libc/stdio/freopen.c libc/stdio/fscanf.c libc/stdio/fseek.c,
        libc/stdio/fseeko.c libc/stdio/fsetpos.c libc/stdio/ftell.c,
        libc/stdio/ftello.c libc/stdio/fvwrite.c libc/stdio/fwalk.c,
        libc/stdio/fwrite.c libc/stdio/getc.c libc/stdio/getc_u.c,
        libc/stdio/getchar.c libc/stdio/getchar_u.c,
        libc/stdio/getdelim.c libc/stdio/getline.c libc/stdio/gets.c,
        libc/stdio/getw.c libc/stdio/iprintf.c libc/stdio/local.h,
        libc/stdio/makebuf.c libc/stdio/mktemp.c libc/stdio/perror.c,
        libc/stdio/printf.c libc/stdio/putc.c libc/stdio/putc_u.c,
        libc/stdio/putchar.c libc/stdio/putchar_u.c libc/stdio/puts.c,
        libc/stdio/putw.c libc/stdio/refill.c libc/stdio/remove.c,
        libc/stdio/rename.c libc/stdio/rewind.c libc/stdio/rget.c,
        libc/stdio/scanf.c libc/stdio/setbuf.c libc/stdio/setbuffer.c,
        libc/stdio/setlinebuf.c libc/stdio/setvbuf.c,
        libc/stdio/siprintf.c libc/stdio/snprintf.c,
        libc/stdio/sprintf.c libc/stdio/sscanf.c libc/stdio/stdio.c,
        libc/stdio/tmpfile.c libc/stdio/tmpnam.c libc/stdio/ungetc.c,
        libc/stdio/vasprintf.c libc/stdio/vfieeefp.h,
        libc/stdio/vfprintf.c libc/stdio/vfscanf.c,
        libc/stdio/vprintf.c libc/stdio/vscanf.c,
        libc/stdio/vsnprintf.c libc/stdio/vsprintf.c,
        libc/stdio/vsscanf.c libc/stdio/wbuf.c,
        libc/stdio/wsetup.c: Perform minor formatting changes.  Move
        copyright notices to top of file, ensure that <_ansi.h> is
        included, be consistent with open parentheses, use _DEFUN macro,
        include "local.h" where needed, and remove various compiler
        warnings.
2004-04-23 20:01:55 +00:00
Corinna Vinschen 8a4b4764b8 * libc/ctype/ctype_.c: Remove checks for deprecated __CYGWIN32__.
* libc/include/stdio.h: Ditto.
	* libc/include/sys/config.h: Ditto.
	* libc/stdio/mktemp.c: Ditto.
2003-05-13 09:46:48 +00:00
Corinna Vinschen 837e070f31 * libc/locale/ldpart.c (__part_load_locale): Substitute
__CYGWIN_USE_BIG_TYPES__ by __USE_INTERNAL_STAT64.
	* libc/search/hash.c (__hash_open): Ditto.
	(init_hash): Ditto.
	* libc/stdio/fseek.c (fseek): Ditto.
	* libc/stdio/makebuf.c (__smakebuf): Ditto.
	* libc/stdio/mktemp.c (_gettemp): Ditto.
2003-05-13 09:19:15 +00:00
Corinna Vinschen 11e3a52072 * configure.host: Accomodate removing the libc/sys/cygwin dir.
* libc/locale/ldpart.c (__part_load_locale): Use 64 bit stat call
	if __CYGWIN_USE_BIG_TYPES__ is set.
	* libc/search/hash.c (__hash_open): Ditto.
	(init_hash): Ditto.
	* libc/stdio/fseek.c (fseek): Ditto.
	* libc/stdio/makebuf.c (__smakebuf): Ditto.
	* libc/stdio/mktemp.c (_gettemp): Ditto.
	* libc/sys/cygwin/Makefile.am: Remove.
	* libc/sys/cygwin/Makefile.in: Remove.
	* libc/sys/cygwin/aclocal.m4: Remove.
	* libc/sys/cygwin/configure: Remove.
	* libc/sys/cygwin/configure.in: Remove.
	* libc/sys/cygwin/crt0.c: Move to winsup/cygwin directory.
	* libc/sys/cygwin/sys/dirent.h: Move to winsup/cygwin/include/sys
	directory.
	* libc/sys/cygwin/sys/param.h: Ditto.
	* libc/sys/cygwin/sys/utime.h: Ditto.
	* libc/sys/cygwin/sys/utmp.h: Ditto.
2003-05-12 11:09:39 +00:00
Thomas Fitzsimmons bfc27bae1a * Various formatting and whitespace changes. 2002-04-30 18:23:40 +00:00
Jeff Johnston ee37ede1d3 2001-02-22 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/machine/setjmp-dj.h: With DJ Delorie's permission,
        changed the copyright information to allow free modification of the
        file with no reference to "copying.dj".
        * libc/include/sys/stat-dj.h: Ditto.
        * libc/machine/i386/setjmp.S: Ditto.
        * libc/sys/h8300hms/sys/file.h: Ditto.
        * libc/sys/sysmec/access.c: Ditto.
        * libc/sys/sysnecv850/access.c: Ditto.
        * libc/stdio/mktemp.c: Fixed typo for the word copyright.
        * libc/stdlib/getenv_r.c: Ditto.
        * libc/stdlib/putenv_r.c: Ditto.
        * libc/stdlib/setenv_r.c: Ditto.
        * libc/stdlib/getenv.c: Removed DJ reference since any possible
        modifications will now be in the _r version of this file.
        * libc/stdlib/putenv.c: Ditto.
        * libc/stdlib/setenv.c: Ditto.
        * libc/sys/go32/copying.dj: Removed DJ's address which is no longer
        valid.  Added a reference to DJ's web page that contains his address.
        * libc/sys/go32/*.s: Removed references to DJ's old address.
        * libc/sys/go32/*.c: Ditto.
        * libc/sys/go32/*.h: Ditto.
        * libc/sys/go32/*.S: Ditto.
        * libc/sys/go32/sys/*.h: Ditto.
2001-02-22 22:12:43 +00:00
Jeff Johnston c87be3e4d6 Mon Apr 17 12:46:00 2000 Marek Michalkiewicz <marekm@linux.org.pl>
* libc/signal/signal.c (_signal_r) : Removed unused local variable temp.        * libc/stdio/findfp.c (std): Added declaration of flags and file.
        * libc/stdio/mktemp.c (_gettemp, _mkstemp_r, mkstemp): Added int
        return type.
        * libc/stdio/putchar.c (putchar): Added return statement.
        * libc/stdio/refill.c (lflush): Added correct parentheses.
        * libc/stdio/vfprintf.c (_VFPRINTF_R): Ditto.
        * libc/stdio/vfscanf.c (__svfscanf): Changed sprintf call which
        prints long value to use l qualifier.
        * libc/stdlib/dtoa.c (_dtoa_r): Added parentheses to remove warning
        messages and initialized local values: ilim, ilim1, and spec_case.
        * libc/stdlib/ecvtbuf.c (print_e): Removed unused variable dp.
        * libc/stdlib/mbctype.h (_issjis1, _issjis2): Added parentheses.
        * libc/stdlib/mprec.c: Ditto.
        * libc/stdlib/setenv_r.c: Ditto.
        * libc/stdlib/strtod.c: Ditto.
        * libc/stdlib/strtol.c: Ditto.
        * libc/stdlib/strtoul.c: Ditto.
        * libm/common/sf_expm1.c: Added curly braces to if else clauses.
        * libm/common/sf_log1p.c: Ditto.
        * libm/common/sf_scalbn.c: Ditto.
        * libm/math/ef_log.c: Ditto.
2000-04-17 17:10:18 +00:00
Christopher Faylor 8a0efa53e4 import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00