Index: ChangeLog =================================================================== RCS file: /cvs/src/src/newlib/ChangeLog,v retrieving revision 1.1231 diff -p -u -r1.1231 ChangeLog --- ChangeLog 25 Nov 2008 09:33:43 -0000 1.1231 +++ ChangeLog 25 Nov 2008 22:51:09 -0000 @@ -1,3 +1,50 @@ +2008-11-25 Craig Howland + + * libc/include/sys/lock.h: Add void cast to avoid "statement has no + effect" warnings from gcc. + * libc/include/sys/stdio.h: Ditto. + * libc/include/sys/time.h: Correct gettimeofday() prototype. + * libc/stdlib/__exp10.c: Add #include "std.h" for function prototype. + * libc/stdlib/__ten_mu.c: Ditto. + * libc/stdlib/std.h: Correct __exp10's ANSI prototype. + * libc/stdlib/ldtoa.c: Change eiisinf definition to ANSI form. (Are + already others in file without _ansi method, so did not bother.) + * libc/stdlib/wcstoul.c: Add #include , correct traditional + synopsis. + * libc/stdlib/strtod.c: Add #include . + * libc/stdlib/system.c: Use _ansi forms for function prototypes and + definitions. + * libc/time/mktime.c: Ditto. + * libc/misc/__dprintf.c: Ditto. + * libc/include/stdio.h: Add function prototypes for _fgetc_r, + _fgetpos_r, _fsetpos_r, _freopen_r, _rewind_r, freopen64, _freopen64_r, + _funopen_r, and _fopencookie_r. + * libc/include/reent.h: Add function prototype for _stat64_r, align + _execve_r prototype with POSIX definition for execve. + * libc/include/wchar.h: Add function prototype for _mbsrtowcs_r. + * libc/reent/execr.c: Align function prototype with POSIX definition. + * libc/stdio/asniprintf.c: Add #include "local.h". + * libc/stdio/vasniprintf.c: Ditto. + * libc/stdio/fread.c: Remove unused variable newcount. + * libc/stdio/local.h: Add function prototype for __sccl. + * libc/stdio/open_memstream.c: Remove unused variable flags. + * libc/stdio/vfscanf.c: Proper prototyping for ccfn, remove prototype + for __sccl since now in local.h. + * libc/string/memcpy.c: Add #include (for real and for + traditional synopsis), remove extraneous stddef.h and limits.h. + * libc/syscalls/sysclose.c: Add #include . + * libc/syscalls/sysfork.c: Ditto. + * libc/syscalls/sysgetpid.c: Ditto. + * libc/syscalls/sysexecve.c: Add #include , align function + prototype with POSIX definition. + * libc/syscalls/sysfstat.c: Add #include . + * libc/syscalls/sysgettod.c: Correct sys/times.h to sys/time.h. + * libc/syscalls/syskill.c: Add #include . + * libc/syscalls/syslink.c: Add #include , fix prototype. + * libc/syscalls/sysunlink.c: Ditto. + * libc/syscalls/sysstat.c: Add #include , fix prototype. + * libc/syscalls/syswait.c: Add #include , fix prototype. + 2008-11-25 Corinna Vinschen * libc/stdio/gets.c (_gets_r): Lock stdin here and call Index: libc/include/sys/lock.h =================================================================== RCS file: /cvs/src/src/newlib/libc/include/sys/lock.h,v retrieving revision 1.3 diff -p -u -r1.3 lock.h --- libc/include/sys/lock.h 16 Sep 2004 21:30:50 -0000 1.3 +++ libc/include/sys/lock.h 25 Nov 2008 22:51:09 -0000 @@ -5,18 +5,20 @@ typedef int _LOCK_T; typedef int _LOCK_RECURSIVE_T; + +#include <_ansi.h> #define __LOCK_INIT(class,lock) static int lock = 0; #define __LOCK_INIT_RECURSIVE(class,lock) static int lock = 0; -#define __lock_init(lock) (0) -#define __lock_init_recursive(lock) (0) -#define __lock_close(lock) (0) -#define __lock_close_recursive(lock) (0) -#define __lock_acquire(lock) (0) -#define __lock_acquire_recursive(lock) (0) -#define __lock_try_acquire(lock) (0) -#define __lock_try_acquire_recursive(lock) (0) -#define __lock_release(lock) (0) -#define __lock_release_recursive(lock) (0) +#define __lock_init(lock) (_CAST_VOID 0) +#define __lock_init_recursive(lock) (_CAST_VOID 0) +#define __lock_close(lock) (_CAST_VOID 0) +#define __lock_close_recursive(lock) (_CAST_VOID 0) +#define __lock_acquire(lock) (_CAST_VOID 0) +#define __lock_acquire_recursive(lock) (_CAST_VOID 0) +#define __lock_try_acquire(lock) (_CAST_VOID 0) +#define __lock_try_acquire_recursive(lock) (_CAST_VOID 0) +#define __lock_release(lock) (_CAST_VOID 0) +#define __lock_release_recursive(lock) (_CAST_VOID 0) #endif /* __SYS_LOCK_H__ */ Index: libc/include/sys/stdio.h =================================================================== RCS file: /cvs/src/src/newlib/libc/include/sys/stdio.h,v retrieving revision 1.3 diff -p -u -r1.3 stdio.h --- libc/include/sys/stdio.h 16 Sep 2004 21:30:50 -0000 1.3 +++ libc/include/sys/stdio.h 25 Nov 2008 22:51:09 -0000 @@ -12,7 +12,7 @@ #ifndef __SINGLE_THREAD__ # define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) #else -# define _flockfile(fp) +# define _flockfile(fp) (_CASTVOID 0) #endif #endif @@ -20,7 +20,7 @@ #ifndef __SINGLE_THREAD__ # define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) #else -# define _funlockfile(fp) +# define _funlockfile(fp) (_CASTVOID 0) #endif #endif Index: libc/include/sys/time.h =================================================================== RCS file: /cvs/src/src/newlib/libc/include/sys/time.h,v retrieving revision 1.11 diff -p -u -r1.11 time.h --- libc/include/sys/time.h 6 Jul 2007 16:56:30 -0000 1.11 +++ libc/include/sys/time.h 25 Nov 2008 22:51:09 -0000 @@ -70,7 +70,7 @@ struct itimerval { } while (0) #endif /* defined (__rtems__) || defined (__CYGWIN__) */ -int _EXFUN(gettimeofday, (struct timeval *__p, void *__tz)); +int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__tz)); int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp)); int _EXFUN(getitimer, (int __which, struct itimerval *__value)); Index: libc/stdlib/__exp10.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdlib/__exp10.c,v retrieving revision 1.1.1.1 diff -p -u -r1.1.1.1 __exp10.c --- libc/stdlib/__exp10.c 17 Feb 2000 19:39:47 -0000 1.1.1.1 +++ libc/stdlib/__exp10.c 25 Nov 2008 22:51:09 -0000 @@ -3,6 +3,7 @@ */ #include <_ansi.h> +#include "std.h" double _DEFUN (__exp10, (x), Index: libc/stdlib/__ten_mu.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdlib/__ten_mu.c,v retrieving revision 1.1.1.1 diff -p -u -r1.1.1.1 __ten_mu.c --- libc/stdlib/__ten_mu.c 17 Feb 2000 19:39:47 -0000 1.1.1.1 +++ libc/stdlib/__ten_mu.c 25 Nov 2008 22:51:09 -0000 @@ -6,6 +6,7 @@ */ #include <_ansi.h> +#include "std.h" int _DEFUN (__ten_mul, (acc, digit), Index: libc/stdlib/std.h =================================================================== RCS file: /cvs/src/src/newlib/libc/stdlib/std.h,v retrieving revision 1.1.1.1 diff -p -u -r1.1.1.1 std.h --- libc/stdlib/std.h 17 Feb 2000 19:39:48 -0000 1.1.1.1 +++ libc/stdlib/std.h 25 Nov 2008 22:51:09 -0000 @@ -25,7 +25,7 @@ #ifdef _HAVE_STDC int __ten_mul(double *acc, int digit); double __adjust(struct _reent *ptr, double *acc, int dexp, int sign); -const double __exp10(unsigned x); +double __exp10(unsigned x); #else int __ten_mul(); double __adjust(); Index: libc/stdlib/ldtoa.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdlib/ldtoa.c,v retrieving revision 1.13 diff -p -u -r1.13 ldtoa.c --- libc/stdlib/ldtoa.c 6 Oct 2008 19:47:06 -0000 1.13 +++ libc/stdlib/ldtoa.c 25 Nov 2008 22:51:10 -0000 @@ -719,8 +719,7 @@ return(0); /* Return nonzero if internal format number is infinite. */ static int -eiisinf (x) - unsigned short x[]; +eiisinf (unsigned short x[]) { #ifdef NANS Index: libc/stdlib/wcstoul.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdlib/wcstoul.c,v retrieving revision 1.1 diff -p -u -r1.1 wcstoul.c --- libc/stdlib/wcstoul.c 6 Jul 2007 20:03:28 -0000 1.1 +++ libc/stdlib/wcstoul.c 25 Nov 2008 22:51:10 -0000 @@ -16,7 +16,7 @@ ANSI_SYNOPSIS wchar_t **<[ptr]>, int <[base]>); TRAD_SYNOPSIS - #include + #include unsigned long wcstoul(<[s]>, <[ptr]>, <[base]>) wchar_t *<[s]>; wchar_t **<[ptr]>; @@ -121,6 +121,7 @@ PORTABILITY #include <_ansi.h> #include #include +#include #include #include #include Index: libc/stdlib/strtod.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdlib/strtod.c,v retrieving revision 1.11 diff -p -u -r1.11 strtod.c --- libc/stdlib/strtod.c 25 Jun 2008 01:45:02 -0000 1.11 +++ libc/stdlib/strtod.c 25 Nov 2008 22:51:10 -0000 @@ -112,6 +112,7 @@ THIS SOFTWARE. #include <_ansi.h> #include +#include #include #include "mprec.h" #include "gdtoa.h" Index: libc/stdlib/system.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdlib/system.c,v retrieving revision 1.8 diff -p -u -r1.8 system.c --- libc/stdlib/system.c 29 May 2007 21:26:59 -0000 1.8 +++ libc/stdlib/system.c 25 Nov 2008 22:51:10 -0000 @@ -53,6 +53,7 @@ Supporting OS subroutines required: <<_e <<_wait_r>>. */ +#include <_ansi.h> #include #include #include @@ -61,13 +62,13 @@ Supporting OS subroutines required: <<_e #include #if defined (unix) || defined (__CYGWIN__) -static int do_system (); +static int _EXFUN(do_system, (struct _reent *ptr _AND _CONST char *s)); #endif int -_system_r (ptr, s) - struct _reent *ptr; - _CONST char *s; +_DEFUN(_system_r, (ptr, s), + struct _reent *ptr _AND + _CONST char *s) { #if defined(HAVE_SYSTEM) return _system (s); @@ -101,8 +102,8 @@ _system_r (ptr, s) #ifndef _REENT_ONLY int -system (s) - _CONST char *s; +_DEFUN(system, (s), + _CONST char *s) { return _system_r (_REENT, s); } @@ -118,9 +119,9 @@ extern char **environ; static char ***p_environ = &environ; static int -do_system (ptr, s) - struct _reent *ptr; - _CONST char *s; +_DEFUN(do_system, (ptr, s), + struct _reent *ptr _AND + _CONST char *s) { char *argv[4]; int pid, status; @@ -150,9 +151,9 @@ do_system (ptr, s) #if defined (__CYGWIN__) static int -do_system (ptr, s) - struct _reent *ptr; - _CONST char *s; +_DEFUN(do_system, (ptr, s), + struct _reent *ptr _AND + _CONST char *s) { char *argv[4]; int pid, status; Index: libc/time/mktime.c =================================================================== RCS file: /cvs/src/src/newlib/libc/time/mktime.c,v retrieving revision 1.6 diff -p -u -r1.6 mktime.c --- libc/time/mktime.c 28 Aug 2008 18:18:12 -0000 1.6 +++ libc/time/mktime.c 25 Nov 2008 22:51:10 -0000 @@ -67,8 +67,8 @@ static _CONST int _DAYS_BEFORE_MONTH[12] #define _DAYS_IN_YEAR(year) (_ISLEAP(year) ? 366 : 365) static void -validate_structure (tim_p) - struct tm *tim_p; +_DEFUN(validate_structure, (tim_p), + struct tm *tim_p) { div_t res; int days_in_feb = 28; @@ -154,8 +154,8 @@ validate_structure (tim_p) } time_t -mktime (tim_p) - struct tm *tim_p; +_DEFUN(mktime, (tim_p), + struct tm *tim_p) { time_t tim = 0; long days = 0; Index: libc/misc/__dprintf.c =================================================================== RCS file: /cvs/src/src/newlib/libc/misc/__dprintf.c,v retrieving revision 1.1 diff -p -u -r1.1 __dprintf.c --- libc/misc/__dprintf.c 23 May 2006 20:30:48 -0000 1.1 +++ libc/misc/__dprintf.c 25 Nov 2008 22:51:10 -0000 @@ -4,6 +4,7 @@ We do assume _write_r is working. */ +#include <_ansi.h> #include "ctype.h" #include "reent.h" #include "string.h" @@ -19,10 +20,10 @@ static char *parse_number (); #endif -static long get_number (); -static void print_number (); -static void write_char (); -static void write_string (); +static long _EXFUN(get_number, (char *, long, int)); +static void _EXFUN(print_number, (int, int, long)); +static void _EXFUN(write_char, (char c)); +static void _EXFUN(write_string, (_CONST char *s)); /* Non-zero for big-endian systems. */ static int big_endian_p; @@ -39,7 +40,7 @@ static int big_endian_p; 20 words at a certain address). A modifier of `N' says the next argument is a count, and the one after that is a pointer. - Example: __dprintf (stderr, "%Nx\n", 20, p); /-* print 20 ints at `p' *-/ + Example: __dprintf ("%Nx\n", 20, p); /-* print 20 ints at `p' *-/ Supported formats are: c d u x s p. @@ -54,7 +55,7 @@ static int big_endian_p; void #ifdef __STDC__ -__dprintf (char *fmt, ...) +__dprintf (const char *fmt, ...) #else __dprintf (fmt, va_alist) char *fmt; @@ -176,10 +177,10 @@ parse_number (s, p) /* Fetch the number at S of SIZE bytes. */ static long -get_number (s, size, unsigned_p) - char *s; - long size; - int unsigned_p; +_DEFUN(get_number, (s, size, unsigned_p), + char *s _AND + long size _AND + int unsigned_p) { long x; unsigned char *p = (unsigned char *) s; @@ -219,10 +220,10 @@ get_number (s, size, unsigned_p) /* Print X in base BASE. */ static void -print_number (base, unsigned_p, n) - int base; - int unsigned_p; - long n; +_DEFUN(print_number, (base, unsigned_p, n), + int base _AND + int unsigned_p _AND + long n) { static char chars[16] = "0123456789abcdef"; char *p, buf[32]; @@ -253,8 +254,8 @@ print_number (base, unsigned_p, n) stdio is working. */ static void -write_char (c) - char c; +_DEFUN(write_char, (c), + char c) { _write_r (_REENT, CONSOLE_FD, &c, 1); } @@ -264,8 +265,8 @@ write_char (c) stdio is working. */ static void -write_string (s) - char *s; +_DEFUN(write_string, (s), + _CONST char *s) { _write_r (_REENT, CONSOLE_FD, s, strlen (s)); } Index: libc/include/stdio.h =================================================================== RCS file: /cvs/src/src/newlib/libc/include/stdio.h,v retrieving revision 1.51 diff -p -u -r1.51 stdio.h --- libc/include/stdio.h 24 Nov 2008 21:27:33 -0000 1.51 +++ libc/include/stdio.h 25 Nov 2008 22:51:11 -0000 @@ -367,13 +367,22 @@ int _EXFUN(_fclose_r, (struct _reent *, int _EXFUN(_fcloseall_r, (struct _reent *)); FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); int _EXFUN(_fflush_r, (struct _reent *, FILE *)); +int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); char * _EXFUN(_fgets_r, (struct _reent *, char *, int, FILE *)); +#ifdef _COMPILING_NEWLIB +int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, _fpos_t *)); +int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); +#else +int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *)); +int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const fpos_t *)); +#endif int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...) _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *, size_t, const char *)); FILE * _EXFUN(_fopen_r, (struct _reent *, const char *, const char *)); +FILE * _EXFUN(_freopen_r, (struct _reent *, const char *, const char *, FILE *)); int _EXFUN(_fprintf_r, (struct _reent *, FILE *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); @@ -385,6 +394,7 @@ int _EXFUN(_fseek_r, (struct _reent *, F int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); long _EXFUN(_ftell_r, (struct _reent *, FILE *)); _off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); +void _EXFUN(_rewind_r, (struct _reent *, FILE *)); size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR , size_t _size, size_t _n, FILE *)); int _EXFUN(_getc_r, (struct _reent *, FILE *)); int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); @@ -475,6 +485,7 @@ ssize_t _EXFUN(__getline, (char **, size #if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) FILE * _EXFUN(fdopen64, (int, const char *)); FILE * _EXFUN(fopen64, (const char *, const char *)); +FILE * _EXFUN(freopen64, (_CONST char *, _CONST char *, FILE *)); _off64_t _EXFUN(ftello64, (FILE *)); _off64_t _EXFUN(fseeko64, (FILE *, _off64_t, int)); int _EXFUN(fgetpos64, (FILE *, _fpos64_t *)); @@ -483,6 +494,7 @@ FILE * _EXFUN(tmpfile64, (void)); FILE * _EXFUN(_fdopen64_r, (struct _reent *, int, const char *)); FILE * _EXFUN(_fopen64_r, (struct _reent *,const char *, const char *)); +FILE * _EXFUN(_freopen64_r, (struct _reent *, _CONST char *, _CONST char *, FILE *)); _off64_t _EXFUN(_ftello64_r, (struct _reent *, FILE *)); _off64_t _EXFUN(_fseeko64_r, (struct _reent *, FILE *, _off64_t, int)); int _EXFUN(_fgetpos64_r, (struct _reent *, FILE *, _fpos64_t *)); @@ -509,12 +521,22 @@ FILE *_EXFUN(funopen,(const _PTR __cooki int (*__writefn)(_PTR __c, const char *__buf, int __n), _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), int (*__closefn)(_PTR __c))); +FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, + int (*__readfn)(_PTR __c, char *__buf, int __n), + int (*__writefn)(_PTR __c, const char *__buf, int __n), + _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), + int (*__closefn)(_PTR __c))); # else FILE *_EXFUN(funopen,(const _PTR __cookie, int (*__readfn)(_PTR __cookie, char *__buf, int __n), int (*__writefn)(_PTR __cookie, const char *__buf, int __n), fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), int (*__closefn)(_PTR __cookie))); +FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, + int (*__readfn)(_PTR __cookie, char *__buf, int __n), + int (*__writefn)(_PTR __cookie, const char *__buf, int __n), + fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), + int (*__closefn)(_PTR __cookie))); # endif /* !__LARGE64_FILES */ # define fropen(__cookie, __fn) funopen(__cookie, __fn, (int (*)())0, \ @@ -541,8 +563,10 @@ typedef struct cookie_seek_function_t *seek; cookie_close_function_t *close; } cookie_io_functions_t; -FILE *_EXFUN(fopencookie,(void *__cookie, const char *__mode, - cookie_io_functions_t __functions)); +FILE *_EXFUN(fopencookie,(void *__cookie, + const char *__mode, cookie_io_functions_t __functions)); +FILE *_EXFUN(_fopencookie_r,(struct _reent *, void *__cookie, + const char *__mode, cookie_io_functions_t __functions)); #endif /* ! __STRICT_ANSI__ */ #ifndef __CUSTOM_FILE_IO__ Index: libc/include/reent.h =================================================================== RCS file: /cvs/src/src/newlib/libc/include/reent.h,v retrieving revision 1.9 diff -p -u -r1.9 reent.h --- libc/include/reent.h 24 Nov 2008 21:27:33 -0000 1.9 +++ libc/include/reent.h 25 Nov 2008 22:51:11 -0000 @@ -137,7 +137,7 @@ struct timezone; /* Reentrant versions of system calls. */ extern int _close_r _PARAMS ((struct _reent *, int)); -extern int _execve_r _PARAMS ((struct _reent *, char *, char **, char **)); +extern int _execve_r _PARAMS ((struct _reent *, const char *, char *const *, char *const *)); extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int)); extern int _fork_r _PARAMS ((struct _reent *)); extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *)); @@ -170,6 +170,7 @@ struct stat64; extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int)); extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *)); extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int)); +extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *)); #endif #endif Index: libc/include/wchar.h =================================================================== RCS file: /cvs/src/src/newlib/libc/include/wchar.h,v retrieving revision 1.16 diff -p -u -r1.16 wchar.h --- libc/include/wchar.h 19 Dec 2007 17:33:11 -0000 1.16 +++ libc/include/wchar.h 25 Nov 2008 22:51:11 -0000 @@ -48,6 +48,7 @@ size_t _EXFUN(_mbrtowc_r, (struct _reent size_t, mbstate_t *)); int _EXFUN(mbsinit, (const mbstate_t *)); size_t _EXFUN(mbsrtowcs, (wchar_t * , const char ** , size_t, mbstate_t *)); +size_t _EXFUN(_mbsrtowcs_r, (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *)); size_t _EXFUN(wcrtomb, (char * , wchar_t, mbstate_t *)); size_t _EXFUN(_wcrtomb_r, (struct _reent *, char * , wchar_t, mbstate_t *)); size_t _EXFUN(wcsrtombs, (char * , const wchar_t ** , size_t, mbstate_t *)); Index: libc/reent/execr.c =================================================================== RCS file: /cvs/src/src/newlib/libc/reent/execr.c,v retrieving revision 1.3 diff -p -u -r1.3 execr.c --- libc/reent/execr.c 3 Jun 2003 19:48:07 -0000 1.3 +++ libc/reent/execr.c 25 Nov 2008 22:51:11 -0000 @@ -35,16 +35,16 @@ INDEX ANSI_SYNOPSIS #include - int _execve_r(struct _reent *<[ptr]>, char *<[name]>, - char **<[argv]>, char **<[env]>); + int _execve_r(struct _reent *<[ptr]>, const char *<[name]>, + char *const <[argv]>[], char *const <[env]>[]); TRAD_SYNOPSIS #include int _execve_r(<[ptr]>, <[name]>, <[argv]>, <[env]>) struct _reent *<[ptr]>; char *<[name]>; - char **<[argv]>; - char **<[env]>; + char *<[argv]>[]; + char *<[env]>[]; DESCRIPTION This is a reentrant version of <>. It @@ -55,9 +55,9 @@ DESCRIPTION int _DEFUN (_execve_r, (ptr, name, argv, env), struct _reent *ptr _AND - char *name _AND - char **argv _AND - char **env) + _CONST char *name _AND + char *_CONST argv[] _AND + char *_CONST env[]) { int ret; Index: libc/stdio/asniprintf.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdio/asniprintf.c,v retrieving revision 1.3 diff -p -u -r1.3 asniprintf.c --- libc/stdio/asniprintf.c 30 Apr 2008 02:47:14 -0000 1.3 +++ libc/stdio/asniprintf.c 25 Nov 2008 22:51:11 -0000 @@ -11,6 +11,7 @@ #include #include #include +#include "local.h" char * _DEFUN(_asniprintf_r, (ptr, buf, lenp, fmt), Index: libc/stdio/vasniprintf.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdio/vasniprintf.c,v retrieving revision 1.3 diff -p -u -r1.3 vasniprintf.c --- libc/stdio/vasniprintf.c 30 Apr 2008 02:47:14 -0000 1.3 +++ libc/stdio/vasniprintf.c 25 Nov 2008 22:51:11 -0000 @@ -11,6 +11,7 @@ #include #include #include +#include "local.h" char * _DEFUN(_vasniprintf_r, (ptr, buf, lenp, fmt, ap), Index: libc/stdio/fread.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdio/fread.c,v retrieving revision 1.15 diff -p -u -r1.15 fread.c --- libc/stdio/fread.c 31 Oct 2008 21:08:03 -0000 1.15 +++ libc/stdio/fread.c 25 Nov 2008 22:51:11 -0000 @@ -87,7 +87,7 @@ _DEFUN(crlf_r, (ptr, fp, buf, count, eof size_t count _AND int eof) { - int newcount = 0, r; + int r; char *s, *d, *e; if (count == 0) Index: libc/stdio/local.h =================================================================== RCS file: /cvs/src/src/newlib/libc/stdio/local.h,v retrieving revision 1.24 diff -p -u -r1.24 local.h --- libc/stdio/local.h 24 Nov 2008 21:27:33 -0000 1.24 +++ libc/stdio/local.h 25 Nov 2008 22:51:11 -0000 @@ -33,6 +33,7 @@ #endif +extern u_char *_EXFUN(__sccl, (char *, u_char *fmt)); extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); extern int _EXFUN(__ssvfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); extern int _EXFUN(__svfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); Index: libc/stdio/open_memstream.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdio/open_memstream.c,v retrieving revision 1.1 diff -p -u -r1.1 open_memstream.c --- libc/stdio/open_memstream.c 2 Aug 2007 20:23:06 -0000 1.1 +++ libc/stdio/open_memstream.c 25 Nov 2008 22:51:11 -0000 @@ -254,7 +254,6 @@ _DEFUN(_open_memstream_r, (ptr, buf, siz { FILE *fp; memstream *c; - int flags; if (!buf || !size) { Index: libc/stdio/vfscanf.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdio/vfscanf.c,v retrieving revision 1.43 diff -p -u -r1.43 vfscanf.c --- libc/stdio/vfscanf.c 24 Nov 2008 17:15:43 -0000 1.43 +++ libc/stdio/vfscanf.c 25 Nov 2008 22:51:11 -0000 @@ -250,8 +250,6 @@ static void * get_arg (int, va_list *, i typedef unsigned long long u_long_long; #endif -/*static*/ u_char *__sccl (); - /* * vfscanf */ @@ -452,7 +450,8 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap size_t mbslen; /* length of converted multibyte sequence */ mbstate_t state; /* value to keep track of multibyte state */ - u_long (*ccfn) () = 0; /* conversion function (strtol/strtoul) */ + #define CCFN_PARAMS _PARAMS((struct _reent *, const char *, char **, int)) + u_long (*ccfn)CCFN_PARAMS=0; /* conversion function (strtol/strtoul) */ char ccltab[256]; /* character class table for %[...] */ char buf[BUF]; /* buffer for numeric conversions */ char *lptr; /* literal pointer */ @@ -656,13 +655,13 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap /* FALLTHROUGH */ case 'd': c = CT_INT; - ccfn = (u_long (*)())_strtol_r; + ccfn = (u_long (*)CCFN_PARAMS)_strtol_r; base = 10; break; case 'i': c = CT_INT; - ccfn = (u_long (*)())_strtol_r; + ccfn = (u_long (*)CCFN_PARAMS)_strtol_r; base = 0; break; @@ -784,7 +783,7 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap if (isupper (c)) flags |= LONG; c = CT_INT; - ccfn = (u_long (*)())_strtol_r; + ccfn = (u_long (*)CCFN_PARAMS)_strtol_r; base = 10; break; } Index: libc/string/memcpy.c =================================================================== RCS file: /cvs/src/src/newlib/libc/string/memcpy.c,v retrieving revision 1.1.1.1 diff -p -u -r1.1.1.1 memcpy.c --- libc/string/memcpy.c 17 Feb 2000 19:39:48 -0000 1.1.1.1 +++ libc/string/memcpy.c 25 Nov 2008 22:51:11 -0000 @@ -7,6 +7,7 @@ ANSI_SYNOPSIS void* memcpy(void *<[out]>, const void *<[in]>, size_t <[n]>); TRAD_SYNOPSIS + #include void *memcpy(<[out]>, <[in]>, <[n]> void *<[out]>; void *<[in]>; @@ -33,8 +34,7 @@ QUICKREF */ #include <_ansi.h> -#include -#include +#include /* Nonzero if either X or Y is not aligned on a "long" boundary. */ #define UNALIGNED(X, Y) \ Index: libc/syscalls/sysclose.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysclose.c,v retrieving revision 1.3 diff -p -u -r1.3 sysclose.c --- libc/syscalls/sysclose.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysclose.c 25 Nov 2008 22:51:11 -0000 @@ -1,6 +1,7 @@ /* connector for close */ #include +#include int _DEFUN (close, (fd), Index: libc/syscalls/sysfork.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysfork.c,v retrieving revision 1.3 diff -p -u -r1.3 sysfork.c --- libc/syscalls/sysfork.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysfork.c 25 Nov 2008 22:51:11 -0000 @@ -5,6 +5,7 @@ #ifndef NO_FORK #include +#include int _DEFUN_VOID (fork) Index: libc/syscalls/sysgetpid.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysgetpid.c,v retrieving revision 1.3 diff -p -u -r1.3 sysgetpid.c --- libc/syscalls/sysgetpid.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysgetpid.c 25 Nov 2008 22:51:11 -0000 @@ -1,6 +1,7 @@ /* connector for getpid */ #include +#include int _DEFUN_VOID (getpid) Index: libc/syscalls/sysexecve.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysexecve.c,v retrieving revision 1.3 diff -p -u -r1.3 sysexecve.c --- libc/syscalls/sysexecve.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysexecve.c 25 Nov 2008 22:51:11 -0000 @@ -1,12 +1,13 @@ /* connector for execve */ #include +#include int _DEFUN (execve, (name, argv, env), - char *name _AND - char **argv _AND - char **env) + _CONST char *name _AND + char *_CONST argv[] _AND + char *_CONST env[]) { return _execve_r (_REENT, name, argv, env); } Index: libc/syscalls/sysfstat.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysfstat.c,v retrieving revision 1.3 diff -p -u -r1.3 sysfstat.c --- libc/syscalls/sysfstat.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysfstat.c 25 Nov 2008 22:51:11 -0000 @@ -1,6 +1,7 @@ /* connector for fstat */ #include +#include #include int Index: libc/syscalls/sysgettod.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysgettod.c,v retrieving revision 1.3 diff -p -u -r1.3 sysgettod.c --- libc/syscalls/sysgettod.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysgettod.c 25 Nov 2008 22:51:11 -0000 @@ -2,10 +2,7 @@ #include #include -#include - -struct timeval; -struct timezone; +#include int _DEFUN (gettimeofday, (ptimeval, ptimezone), Index: libc/syscalls/syskill.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/syskill.c,v retrieving revision 1.3 diff -p -u -r1.3 syskill.c --- libc/syscalls/syskill.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/syskill.c 25 Nov 2008 22:51:11 -0000 @@ -1,6 +1,7 @@ /* connector for kill */ #include +#include int _DEFUN (kill, (pid, sig), Index: libc/syscalls/syslink.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/syslink.c,v retrieving revision 1.3 diff -p -u -r1.3 syslink.c --- libc/syscalls/syslink.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/syslink.c 25 Nov 2008 22:51:11 -0000 @@ -1,11 +1,12 @@ /* connector for link */ #include +#include int _DEFUN (link, (old, new), - char *old _AND - char *new) + _CONST char *old _AND + _CONST char *new) { return _link_r (_REENT, old, new); } Index: libc/syscalls/sysunlink.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysunlink.c,v retrieving revision 1.3 diff -p -u -r1.3 sysunlink.c --- libc/syscalls/sysunlink.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysunlink.c 25 Nov 2008 22:51:11 -0000 @@ -1,10 +1,11 @@ /* connector for unlink */ #include +#include int _DEFUN (unlink, (file), - char *file) + _CONST char *file) { return _unlink_r (_REENT, file); } Index: libc/syscalls/sysstat.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/sysstat.c,v retrieving revision 1.3 diff -p -u -r1.3 sysstat.c --- libc/syscalls/sysstat.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/sysstat.c 25 Nov 2008 22:51:11 -0000 @@ -1,11 +1,12 @@ /* connector for stat */ #include +#include #include int _DEFUN (stat, (file, pstat), - char *file _AND + _CONST char *file _AND struct stat *pstat) { return _stat_r (_REENT, file, pstat); Index: libc/syscalls/syswait.c =================================================================== RCS file: /cvs/src/src/newlib/libc/syscalls/syswait.c,v retrieving revision 1.3 diff -p -u -r1.3 syswait.c --- libc/syscalls/syswait.c 3 Jan 2008 00:16:49 -0000 1.3 +++ libc/syscalls/syswait.c 25 Nov 2008 22:51:11 -0000 @@ -1,8 +1,9 @@ /* connector for wait */ #include +#include -int +pid_t _DEFUN (wait, (status), int *status) {