Commit Graph

13 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 aa06fa01dc posix: remove TRAD_SYNOPSIS 2017-12-01 03:41:50 -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 e9708d920c * libc/posix/popen.c (popen): Fix documented prototype. 2009-08-18 17:07:55 +00:00
Eric Blake a051160962 Improve popen compatibility with glibc.
* libc/posix/popen.c (popen): The 2006-08-22 change to use
FD_CLOEXEC disagrees with other implementations; instead, use
pidlist to work even when fcntl is not available.  Meanwhile,
support the 'e' modifier to set CLOEXEC, as in glibc.  Drop
cygwin-specific code, now that cygwin has its own version.
* libc/posix/Makefile.am (CHEWOUT_FILES): Document popen.
* libc/posix/posix.tex: New file.
2009-08-18 16:43:21 +00:00
Jeff Johnston d456d606e3 2008-10-31 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/limits.h: Add ARG_MAX, PATH_MAX, and _POSIX2_RE_DUP_MAX.
        * libc/include/envlock.h: New file.
        * libc/include/fnmatch.h: Ditto.
        * libc/include/glob.h: Ditto.
        * libc/include/regex.h: Ditto.
        * libc/include/wordexp.h: Ditto.
        * libc/posix/Makefile.am: Add new files moved from
        libc/sys/linux/stdlib.
        * libc/posix/Makefile.in: Regenerated.
        * libc/posix/COPYRIGHT: New file moved from libc/sys/linux/stdlib.
        * libc/posix/cclass.h: Ditto.
        * libc/posix/cname.h: Ditto.
        * libc/posix/collate.c: Ditto.
        * libc/posix/collate.h: Ditto.
        * libc/posix/collcmp.c: Ditto.
        * libc/posix/engine.c: Ditto.
        * libc/posix/fnmatch.3: Ditto.
        * libc/posix/glob.3: Ditto.
        * libc/posix/fnmatch.c: Ditto.
        * libc/posix/glob.c: Ditto.
        * libc/posix/namespace.h: Ditto.
        * libc/posix/reallocf.c: Ditto.
        * libc/posix/regcomp.c: Ditto.
        * libc/posix/regerror.c: Ditto.
        * libc/posix/regex.3: Ditto.
        * libc/posix/regex2.h: Ditto.
        * libc/posix/regexec.c: Ditto.
        * libc/posix/regfree.c: Ditto.
        * libc/posix/rune.h: Ditto.
        * libc/posix/runetype.h: Ditto.
        * libc/posix/scandir.c: Remove advertising clause which is not in
        effect.
        * libc/posix/sysexits.h: Ditto.
        * libc/posix/un-namespace.h: Ditto.
        * libc/posix/utils.h: Ditto.
        * libc/posix/wordexp.c: Ditto.
        * libc/posix/wordfree.c: Ditto.
        * libc/posix/execl.c: Add !_NO_EXECVE flag check.
        * libc/posix/execle.c: Ditto.
        * libc/posix/execlp.c: Ditto.
        * libc/posix/execv.c: Ditto.
        * libc/posix/execve.c: Ditto.
        * libc/posix/execvp.c: Ditto.
        * libc/posix/popen.c: Add !_NO_POPEN flag check.
        * libc/sys/linux/configure: Regenerated.
        * libc/sys/linux/configure.in: Remove stdlib.
        * libc/sys/linux/include/limits.h: Add include of linux/limits.h.
        * libc/sys/linux/stdlib/Makefile.am: Removed.
        * libc/sys/linux/stdlib/Makefile.in: Ditto.
        * libc/sys/linux/stdlib/COPYRIGHT: Moved to libc/posix.
        * libc/sys/linux/stdlib/cclass.h: Ditto.
        * libc/sys/linux/stdlib/cname.h: Ditto.
        * libc/sys/linux/stdlib/collate.c: Ditto.
        * libc/sys/linux/stdlib/collate.h: Ditto.
        * libc/sys/linux/stdlib/collcmp.c: Ditto.
        * libc/sys/linux/stdlib/engine.c: Ditto.
        * libc/sys/linux/stdlib/fnmatch.3: Ditto.
        * libc/sys/linux/stdlib/fnmatch.c: Ditto.
        * libc/sys/linux/stdlib/glob.3: Ditto.
        * libc/sys/linux/stdlib/glob.c: Ditto.
        * libc/sys/linux/stdlib/reallocf.c: Ditto.
        * libc/sys/linux/stdlib/regcomp.c: Ditto.
        * libc/sys/linux/stdlib/regerror.c: Ditto.
        * libc/sys/linux/stdlib/regex.3: Ditto.
        * libc/sys/linux/stdlib/regex2.h: Ditto.
        * libc/sys/linux/stdlib/regexec.c: Ditto.
        * libc/sys/linux/stdlib/regfree.c: Ditto.
        * libc/sys/linux/stdlib/utils.h: Ditto.
        * libc/sys/linux/stdlib/wordexp.c: Ditto.
        * libc/sys/linux/stdlib/wordfree.c: Ditto.
2008-10-31 21:03:42 +00:00
Jeff Johnston 380d8ec45d 2006-08-22 Eric Blake <ebb9@byu.net>
* libc/posix/popen.c (popen): Don't close output end of pipe in
        child if stdout was closed on entry.
        [HAVE_FCNTL]: In parent, mark file as close-on-exec, per POSIX.
2006-08-22 20:30:37 +00:00
Jeff Johnston 729d1ff9d8 2003-06-06 Jeff Johnston <jjohnstn@redhat.com>
* libc/argz/argz_add.c: Change to use _DEFUN macro for function
        definition.
        * libc/argz/argz_add_sep.c: Ditto.
        * libc/argz/argz_append.c libc/argz/argz_count.c: Ditto.
        * libc/argz/argz_create.c libc/argz/argz_create_sep.c: Ditto.
        * libc/argz/argz_delete.c libc/argz/argz_extract.c: Ditto.
        * libc/argz/argz_insert.c libc/argz/argz_next.c: Ditto.
        * libc/argz/argz_replace.c libc/argz/argz_stringify.c: Ditto.
        * libc/argz/envz_add.c libc/argz/envz_entry.c: Ditto.
        * libc/argz/envz_get.c libc/argz/envz_merge.c: Ditto.
        * libc/argz/envz_remove.c libc/argz/envz_strip.c: Ditto.
        * libc/locale/nl_langinfo.c libc/misc/ffs.c: Ditto.
        * libc/posix/closedir.c libc/posix/creat.c: Ditto.
        * libc/posix/execl.c libc/posix/execle.c: Ditto.
        * libc/posix/execlp.c libc/posix/execve.c: Ditto.
        * libc/posix/isatty.c libc/posix/opendir.c: Ditto.
        * libc/posix/popen.c libc/posix/readdir.c: Ditto.
        * libc/posix/readdir_r.c libc/posix/rewinddir.c: Ditto.
        * libc/posix/scandir.c libc/posix/seekdir.c: Ditto.
        * libc/posix/telldir.c libc/search/hcreate.c: Ditto.
        * libc/search/tdelete.c libc/search/tdestroy.c: Ditto.
        * libc/search/tfind.c libc/search/tsearch.c: Ditto.
        * libc/search/twalk.c libc/signal/signal.c: Ditto.
2003-06-06 19:57:51 +00:00
Christopher Faylor 4866247e29 * libc/stdio/popen.c (popen): Allow "rb", "rt", "wb", and "wt" arguments for
popen to match similar functionality in fopen.
2002-08-04 19:01:56 +00:00
Christopher Faylor 333d609843 * libc/posix/execvp.c: Remove obsolete CYGWIN32 considerations throughout.
* signal.h: Change comment to reflect __CYGWIN__ rather than __CYGWIN32__.
* popen.c (popen): Use __CYGWIN_ rather than __CYGWIN32__.
* system.c (_system_r): Ditto.
2001-10-22 16:40:26 +00:00
Jeff Johnston 2d5862dee6 2000-08-23 Werner Almesberger <Werner.Almesberger@epfl.ch>
* libc/stdlib/mprec.c (ulp, b2d, d2b): changed a few expressions
        like  x << y-z  to the equivalent  x << (y-z).
        (d2b): changed if statements with assignment to perform the
        assignment prior to the if check.
        * libc/reent/reent.c: included stdlib.h for "_free_r" prototype.
        * libc/unix/getpass.c (getpass): moved "echo" assignment out of if.
        * libc/unix/ttyname.c: included string.h for "strcpy" prototype.
        * libc/unix/getcwd.c (ISDOT): added parentheses to clarify && and ||
        precedence.
        * libc/include/sys/unistd.h: added "vfork" prototype (for popen.c).
        Added "_execve" prototype (for execl.c, execle.c, execv.c, and
        execve.c).
        * libc/posix/popen.c (popen): added parentheses to clarify && and ||
        precedence.
        * libm/math/e_cosh.c (__ieee754_cosh): changed parentheses to
        clarify && and || precendence (and to remove pascalism).
        * libm/math/e_sinh.c (__ieee754_sinh): Ditto.
        * libm/math/s_infconst.c: added another pair of braces to all
        initializers for __infinity (need three: for __infinity[1] array,
        for union __dmath, and for i[2]).
2000-08-24 22:32:38 +00:00
Christopher Faylor 8a0efa53e4 import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00