PATCH - Add C99 restrict to stdio

Joel Sherrill joel.sherrill@oarcorp.com
Fri Nov 15 18:51:00 GMT 2013


Hi

Attached is a patch which adds the restrict keyword
as required to stdio.h methods. An attempt was made
to add them everywhere. I only built the documentation
and sparc-rtems.

If someone could compile the spu, that would be appreciated.

Otherwise, please review. and OK to apply?

2013-11-15  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.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985
-------------- next part --------------
Index: newlib/libc/include/stdio.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/stdio.h,v
retrieving revision 1.66
diff -u -r1.66 stdio.h
--- newlib/libc/include/stdio.h	24 Oct 2013 01:21:33 -0000	1.66
+++ newlib/libc/include/stdio.h	15 Nov 2013 18:23:29 -0000
@@ -163,29 +163,29 @@
 char *	_EXFUN(tmpnam, (char *));
 int	_EXFUN(fclose, (FILE *));
 int	_EXFUN(fflush, (FILE *));
-FILE *	_EXFUN(freopen, (const char *, const char *, FILE *));
-void	_EXFUN(setbuf, (FILE *, char *));
-int	_EXFUN(setvbuf, (FILE *, char *, int, size_t));
-int	_EXFUN(fprintf, (FILE *, const char *, ...)
+FILE *	_EXFUN(freopen, (const char *__restrict, const char *__restrict, FILE *__restrict));
+void	_EXFUN(setbuf, (FILE *__restrict, char *__restrict));
+int	_EXFUN(setvbuf, (FILE *__restrict, char *__restrict, int, size_t));
+int	_EXFUN(fprintf, (FILE *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
-int	_EXFUN(fscanf, (FILE *, const char *, ...)
+int	_EXFUN(fscanf, (FILE *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
-int	_EXFUN(printf, (const char *, ...)
+int	_EXFUN(printf, (const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 1, 2))));
-int	_EXFUN(scanf, (const char *, ...)
+int	_EXFUN(scanf, (const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__scanf__, 1, 2))));
-int	_EXFUN(sscanf, (const char *, const char *, ...)
+int	_EXFUN(sscanf, (const char *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
-int	_EXFUN(vfprintf, (FILE *, const char *, __VALIST)
+int	_EXFUN(vfprintf, (FILE *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
 int	_EXFUN(vprintf, (const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 1, 0))));
-int	_EXFUN(vsprintf, (char *, const char *, __VALIST)
+int	_EXFUN(vsprintf, (char *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
 int	_EXFUN(fgetc, (FILE *));
-char *  _EXFUN(fgets, (char *, int, FILE *));
+char *  _EXFUN(fgets, (char *__restrict, int, FILE *__restrict));
 int	_EXFUN(fputc, (int, FILE *));
-int	_EXFUN(fputs, (const char *, FILE *));
+int	_EXFUN(fputs, (const char *__restrict, FILE *__restrict));
 int	_EXFUN(getc, (FILE *));
 int	_EXFUN(getchar, (void));
 char *  _EXFUN(gets, (char *));
@@ -193,12 +193,12 @@
 int	_EXFUN(putchar, (int));
 int	_EXFUN(puts, (const char *));
 int	_EXFUN(ungetc, (int, FILE *));
-size_t	_EXFUN(fread, (_PTR, size_t _size, size_t _n, FILE *));
-size_t	_EXFUN(fwrite, (const _PTR , size_t _size, size_t _n, FILE *));
+size_t	_EXFUN(fread, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict));
+size_t	_EXFUN(fwrite, (const _PTR __restrict , size_t _size, size_t _n, FILE *));
 #ifdef _COMPILING_NEWLIB
 int	_EXFUN(fgetpos, (FILE *, _fpos_t *));
 #else
-int	_EXFUN(fgetpos, (FILE *, fpos_t *));
+int	_EXFUN(fgetpos, (FILE *__restrict, fpos_t *__restrict));
 #endif
 int	_EXFUN(fseek, (FILE *, long, int));
 #ifdef _COMPILING_NEWLIB
@@ -213,8 +213,8 @@
 int	_EXFUN(ferror, (FILE *));
 void    _EXFUN(perror, (const char *));
 #ifndef _REENT_ONLY
-FILE *	_EXFUN(fopen, (const char *_name, const char *_type));
-int	_EXFUN(sprintf, (char *, const char *, ...)
+FILE *	_EXFUN(fopen, (const char *__restrict _name, const char *__restrict _type));
+int	_EXFUN(sprintf, (char *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
 int	_EXFUN(remove, (const char *));
 int	_EXFUN(rename, (const char *, const char *));
@@ -237,9 +237,9 @@
                _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
 char *	_EXFUN(asniprintf, (char *, size_t *, const char *, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
-char *	_EXFUN(asnprintf, (char *, size_t *, const char *, ...)
+char *	_EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
-int	_EXFUN(asprintf, (char **, const char *, ...)
+int	_EXFUN(asprintf, (char **__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
 #ifndef diprintf
 int	_EXFUN(diprintf, (int, const char *, ...)
@@ -258,7 +258,7 @@
                _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
 int	_EXFUN(siscanf, (const char *, const char *, ...)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
-int	_EXFUN(snprintf, (char *, size_t, const char *, ...)
+int	_EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
 int	_EXFUN(sniprintf, (char *, size_t, const char *, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
@@ -277,7 +277,7 @@
                _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
 int	_EXFUN(vfiscanf, (FILE *, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
-int	_EXFUN(vfscanf, (FILE *, const char *, __VALIST)
+int	_EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
 int	_EXFUN(viprintf, (const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 1, 0))));
@@ -291,9 +291,9 @@
                _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
 int	_EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
-int	_EXFUN(vsnprintf, (char *, size_t, const char *, __VALIST)
+int	_EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
-int	_EXFUN(vsscanf, (const char *, const char *, __VALIST)
+int	_EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
 #endif /* !_REENT_ONLY */
 #endif /* !__STRICT_ANSI__ */
@@ -329,17 +329,17 @@
 #ifndef __STRICT_ANSI__
 # ifndef _REENT_ONLY
 #  ifndef dprintf
-int	_EXFUN(dprintf, (int, const char *, ...)
+int	_EXFUN(dprintf, (int, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
 #  endif
-FILE *	_EXFUN(fmemopen, (void *, size_t, const char *));
+FILE *	_EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict));
 /* getdelim - see __getdelim for now */
 /* getline - see __getline for now */
 FILE *	_EXFUN(open_memstream, (char **, size_t *));
 #if defined (__CYGWIN__)
 int	_EXFUN(renameat, (int, const char *, int, const char *));
 #endif
-int	_EXFUN(vdprintf, (int, const char *, __VALIST)
+int	_EXFUN(vdprintf, (int, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
 # endif
 #endif
@@ -352,22 +352,22 @@
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
 char *	_EXFUN(_asniprintf_r, (struct _reent *, char *, size_t *, const char *, ...)
                _ATTRIBUTE ((__format__ (__printf__, 4, 5))));
-char *	_EXFUN(_asnprintf_r, (struct _reent *, char *, size_t *, const char *, ...)
+char *	_EXFUN(_asnprintf_r, (struct _reent *, char *__restrict, size_t *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 4, 5))));
-int	_EXFUN(_asprintf_r, (struct _reent *, char **, const char *, ...)
+int	_EXFUN(_asprintf_r, (struct _reent *, char **__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
 int	_EXFUN(_diprintf_r, (struct _reent *, int, const char *, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
-int	_EXFUN(_dprintf_r, (struct _reent *, int, const char *, ...)
+int	_EXFUN(_dprintf_r, (struct _reent *, int, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
 int	_EXFUN(_fclose_r, (struct _reent *, FILE *));
 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 *));
+char *  _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict));
 #ifdef _COMPILING_NEWLIB
-int	_EXFUN(_fgetpos_r, (struct _reent *, FILE *, _fpos_t *));
+int	_EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict));
 int	_EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *));
 #else
 int	_EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *));
@@ -377,23 +377,23 @@
                _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 *, ...)
+FILE *	_EXFUN(_fmemopen_r, (struct _reent *, void *__restrict, size_t, const char *__restrict));
+FILE *	_EXFUN(_fopen_r, (struct _reent *, const char *__restrict, const char *__restrict));
+FILE *	_EXFUN(_freopen_r, (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict));
+int	_EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
 int	_EXFUN(_fpurge_r, (struct _reent *, FILE *));
 int	_EXFUN(_fputc_r, (struct _reent *, int, FILE *));
-int	_EXFUN(_fputs_r, (struct _reent *, const char *, FILE *));
-size_t	_EXFUN(_fread_r, (struct _reent *, _PTR, size_t _size, size_t _n, FILE *));
-int	_EXFUN(_fscanf_r, (struct _reent *, FILE *, const char *, ...)
+int	_EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict));
+size_t	_EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict));
+int	_EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__scanf__, 3, 4))));
 int	_EXFUN(_fseek_r, (struct _reent *, FILE *, long, int));
 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 *));
+size_t	_EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict));
 int	_EXFUN(_getc_r, (struct _reent *, FILE *));
 int	_EXFUN(_getc_unlocked_r, (struct _reent *, FILE *));
 int	_EXFUN(_getchar_r, (struct _reent *));
@@ -405,7 +405,7 @@
                _ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
 FILE *	_EXFUN(_open_memstream_r, (struct _reent *, char **, size_t *));
 void	_EXFUN(_perror_r, (struct _reent *, const char *));
-int	_EXFUN(_printf_r, (struct _reent *, const char *, ...)
+int	_EXFUN(_printf_r, (struct _reent *, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
 int	_EXFUN(_putc_r, (struct _reent *, int, FILE *));
 int	_EXFUN(_putc_unlocked_r, (struct _reent *, int, FILE *));
@@ -415,7 +415,7 @@
 int	_EXFUN(_remove_r, (struct _reent *, const char *));
 int	_EXFUN(_rename_r, (struct _reent *,
 			   const char *_old, const char *_new));
-int	_EXFUN(_scanf_r, (struct _reent *, const char *, ...)
+int	_EXFUN(_scanf_r, (struct _reent *, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
 int	_EXFUN(_siprintf_r, (struct _reent *, char *, const char *, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
@@ -423,11 +423,11 @@
                _ATTRIBUTE ((__format__ (__scanf__, 3, 4))));
 int	_EXFUN(_sniprintf_r, (struct _reent *, char *, size_t, const char *, ...)
                _ATTRIBUTE ((__format__ (__printf__, 4, 5))));
-int	_EXFUN(_snprintf_r, (struct _reent *, char *, size_t, const char *, ...)
+int	_EXFUN(_snprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 4, 5))));
-int	_EXFUN(_sprintf_r, (struct _reent *, char *, const char *, ...)
+int	_EXFUN(_sprintf_r, (struct _reent *, char *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 3, 4))));
-int	_EXFUN(_sscanf_r, (struct _reent *, const char *, const char *, ...)
+int	_EXFUN(_sscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__scanf__, 3, 4))));
 char *	_EXFUN(_tempnam_r, (struct _reent *, const char *, const char *));
 FILE *	_EXFUN(_tmpfile_r, (struct _reent *));
@@ -443,23 +443,23 @@
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
 int	_EXFUN(_vdiprintf_r, (struct _reent *, int, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
-int	_EXFUN(_vdprintf_r, (struct _reent *, int, const char *, __VALIST)
+int	_EXFUN(_vdprintf_r, (struct _reent *, int, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
 int	_EXFUN(_vfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
 int	_EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
-int	_EXFUN(_vfprintf_r, (struct _reent *, FILE *, const char *, __VALIST)
+int	_EXFUN(_vfprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
-int	_EXFUN(_vfscanf_r, (struct _reent *, FILE *, const char *, __VALIST)
+int	_EXFUN(_vfscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
 int	_EXFUN(_viprintf_r, (struct _reent *, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
 int	_EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
-int	_EXFUN(_vprintf_r, (struct _reent *, const char *, __VALIST)
+int	_EXFUN(_vprintf_r, (struct _reent *, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
-int	_EXFUN(_vscanf_r, (struct _reent *, const char *, __VALIST)
+int	_EXFUN(_vscanf_r, (struct _reent *, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
 int	_EXFUN(_vsiprintf_r, (struct _reent *, char *, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
@@ -467,11 +467,11 @@
                _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
 int	_EXFUN(_vsniprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 4, 0))));
-int	_EXFUN(_vsnprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST)
+int	_EXFUN(_vsnprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 4, 0))));
-int	_EXFUN(_vsprintf_r, (struct _reent *, char *, const char *, __VALIST)
+int	_EXFUN(_vsprintf_r, (struct _reent *, char *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__printf__, 3, 0))));
-int	_EXFUN(_vsscanf_r, (struct _reent *, const char *, const char *, __VALIST)
+int	_EXFUN(_vsscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, __VALIST)
                _ATTRIBUTE ((__format__ (__scanf__, 3, 0))));
 
 /* Other extensions.  */
Index: newlib/libc/machine/powerpc/vfscanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/powerpc/vfscanf.c,v
retrieving revision 1.17
diff -u -r1.17 vfscanf.c
--- newlib/libc/machine/powerpc/vfscanf.c	12 Jan 2009 23:32:37 -0000	1.17
+++ newlib/libc/machine/powerpc/vfscanf.c	15 Nov 2013 18:23:29 -0000
@@ -12,15 +12,15 @@
 ANSI_SYNOPSIS
 	#include <stdio.h>
 	#include <stdarg.h>
-	int vscanf(const char *<[fmt]>, va_list <[list]>);
-	int vfscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
-	int vsscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>);
+	int vscanf(const char *restrict <[fmt]>, va_list <[list]>);
+	int vfscanf(FILE *restrict <[fp]>, const char *restrict <[fmt]>, va_list <[list]>);
+	int vsscanf(const char *restrict <[str]>, const char *restrict <[fmt]>, va_list <[list]>);
 
-	int _vscanf_r(void *<[reent]>, const char *<[fmt]>, 
+	int _vscanf_r(void *<[reent]>, const char *restrict <[fmt]>, 
                        va_list <[list]>);
-	int _vfscanf_r(void *<[reent]>, FILE *<[fp]>, const char *<[fmt]>, 
+	int _vfscanf_r(void *<[reent]>, FILE *restrict <[fp]>, const char *restrict <[fmt]>, 
                        va_list <[list]>);
-	int _vsscanf_r(void *<[reent]>, const char *<[str]>, const char *<[fmt]>, 
+	int _vsscanf_r(void *<[reent]>, const char *restrict <[str]>, const char *restrict <[fmt]>, 
                        va_list <[list]>);
 
 TRAD_SYNOPSIS
@@ -218,8 +218,8 @@
 
 int
 _DEFUN (vfscanf, (fp, fmt, ap), 
-    register FILE *fp _AND 
-    _CONST char *fmt _AND 
+    register FILE *__restrict fp _AND 
+    _CONST char *__restrict fmt _AND 
     va_list ap)
 {
   CHECK_INIT(_REENT, fp);
@@ -240,8 +240,8 @@
 int
 _DEFUN (_vfscanf_r, (data, fp, fmt, ap),
     struct _reent *data _AND 
-    register FILE *fp _AND 
-    _CONST char *fmt _AND 
+    register FILE *__restrict fp _AND 
+    _CONST char *__restrict fmt _AND 
     va_list ap)
 {
   return __svfscanf_r (data, fp, fmt, ap);
Index: newlib/libc/machine/spu/fgetpos.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/fgetpos.c,v
retrieving revision 1.3
diff -u -r1.3 fgetpos.c
--- newlib/libc/machine/spu/fgetpos.c	23 May 2007 21:41:17 -0000	1.3
+++ newlib/libc/machine/spu/fgetpos.c	15 Nov 2013 18:23:29 -0000
@@ -45,8 +45,8 @@
 
 int
 _DEFUN (fgetpos, (fp, pos),
-	FILE * fp _AND
-	_fpos_t * pos)
+	FILE *__restrict fp _AND
+	_fpos_t *__restrict pos)
 {
   c99_fgetpos_t arg;
 
Index: newlib/libc/machine/spu/fgets.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/fgets.c,v
retrieving revision 1.3
diff -u -r1.3 fgets.c
--- newlib/libc/machine/spu/fgets.c	23 May 2007 21:41:17 -0000	1.3
+++ newlib/libc/machine/spu/fgets.c	15 Nov 2013 18:23:29 -0000
@@ -47,9 +47,9 @@
 
 char *
 _DEFUN (fgets, (buf, n, fp),
-	char *buf _AND
+	char *__restrict buf _AND
 	int n _AND
-	FILE * fp)
+	FILE *__restrict fp)
 {
   c99_fgets_t args;
 
Index: newlib/libc/machine/spu/fopen.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/fopen.c,v
retrieving revision 1.3
diff -u -r1.3 fopen.c
--- newlib/libc/machine/spu/fopen.c	23 May 2007 21:41:17 -0000	1.3
+++ newlib/libc/machine/spu/fopen.c	15 Nov 2013 18:23:29 -0000
@@ -46,8 +46,8 @@
 #ifndef _REENT_ONLY
 FILE *
 _DEFUN (fopen, (file, mode),
-	_CONST char *file _AND
-	_CONST char *mode)
+	_CONST char *__restrict file _AND
+	_CONST char *__restrict mode)
 {
   int ret;
   c99_fopen_t args;
Index: newlib/libc/machine/spu/fputs.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/fputs.c,v
retrieving revision 1.3
diff -u -r1.3 fputs.c
--- newlib/libc/machine/spu/fputs.c	23 May 2007 21:41:17 -0000	1.3
+++ newlib/libc/machine/spu/fputs.c	15 Nov 2013 18:23:29 -0000
@@ -47,8 +47,8 @@
 
 int
 _DEFUN (fputs, (s, fp),
-	char _CONST * s _AND
-	FILE * fp)
+	char _CONST *__restrict s _AND
+	FILE *__restrict fp)
 {
   c99_fputs_t args;
 
Index: newlib/libc/machine/spu/fread.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/fread.c,v
retrieving revision 1.3
diff -u -r1.3 fread.c
--- newlib/libc/machine/spu/fread.c	23 May 2007 21:41:17 -0000	1.3
+++ newlib/libc/machine/spu/fread.c	15 Nov 2013 18:23:29 -0000
@@ -50,10 +50,10 @@
 
 size_t
 _DEFUN (fread, (buf, size, count, fp),
-	_PTR buf _AND
+	_PTR __restrict  buf _AND
 	size_t size _AND
 	size_t count _AND
-	FILE * fp)
+	FILE *__restrict fp)
 {
   c99_fread_t args;
 
Index: newlib/libc/machine/spu/freopen.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/freopen.c,v
retrieving revision 1.3
diff -u -r1.3 freopen.c
--- newlib/libc/machine/spu/freopen.c	23 May 2007 21:41:17 -0000	1.3
+++ newlib/libc/machine/spu/freopen.c	15 Nov 2013 18:23:29 -0000
@@ -48,9 +48,9 @@
 
 FILE *
 _DEFUN (freopen, (file, mode, fp),
-	const char *file _AND
-	const char *mode _AND
-	FILE *fp)
+	const char *__restrict file _AND
+	const char *__restrict mode _AND
+	FILE *__restrict fp)
 {
   int ret;
   c99_freopen_t args;
Index: newlib/libc/machine/spu/fwrite.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/fwrite.c,v
retrieving revision 1.3
diff -u -r1.3 fwrite.c
--- newlib/libc/machine/spu/fwrite.c	23 May 2007 21:41:17 -0000	1.3
+++ newlib/libc/machine/spu/fwrite.c	15 Nov 2013 18:23:29 -0000
@@ -50,7 +50,7 @@
 
 size_t
 _DEFUN (fwrite, (buf, size, count, fp),
-	_CONST _PTR buf _AND
+	_CONST _PTR __restrict buf _AND
 	size_t size _AND
 	size_t count _AND
 	FILE * fp)
Index: newlib/libc/machine/spu/setbuf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/setbuf.c,v
retrieving revision 1.2
diff -u -r1.2 setbuf.c
--- newlib/libc/machine/spu/setbuf.c	4 Apr 2007 21:03:13 -0000	1.2
+++ newlib/libc/machine/spu/setbuf.c	15 Nov 2013 18:23:29 -0000
@@ -47,8 +47,8 @@
 
 void
 _DEFUN (setbuf, (fp, buf),
-	FILE * fp _AND
-	char *buf)
+	FILE *__restrict fp _AND
+	char *__restrict buf)
 {
   c99_setbuf_t args;
 
Index: newlib/libc/machine/spu/vfprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/vfprintf.c,v
retrieving revision 1.4
diff -u -r1.4 vfprintf.c
--- newlib/libc/machine/spu/vfprintf.c	23 May 2007 21:41:17 -0000	1.4
+++ newlib/libc/machine/spu/vfprintf.c	15 Nov 2013 18:23:29 -0000
@@ -58,8 +58,8 @@
 
 int
 _DEFUN (vfprintf, (fp, fmt0, ap),
-	FILE * fp _AND
-	_CONST char *fmt0 _AND
+	FILE *__restrict fp _AND
+	_CONST char *__restrict fmt0 _AND
 	va_list ap)
 {
   c99_vfprintf_t args;
Index: newlib/libc/machine/spu/vfscanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/vfscanf.c,v
retrieving revision 1.4
diff -u -r1.4 vfscanf.c
--- newlib/libc/machine/spu/vfscanf.c	23 May 2007 21:41:17 -0000	1.4
+++ newlib/libc/machine/spu/vfscanf.c	15 Nov 2013 18:23:29 -0000
@@ -58,8 +58,8 @@
 
 int
 _DEFUN (vfscanf, (fp, fmt, ap),
-    FILE *fp _AND
-    _CONST char *fmt _AND
+    FILE *__restrict fp _AND
+    _CONST char *__restrict fmt _AND
     va_list ap)
 {
   c99_vfscanf_t args;
Index: newlib/libc/machine/spu/vsnprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/vsnprintf.c,v
retrieving revision 1.6
diff -u -r1.6 vsnprintf.c
--- newlib/libc/machine/spu/vsnprintf.c	23 May 2007 21:41:17 -0000	1.6
+++ newlib/libc/machine/spu/vsnprintf.c	15 Nov 2013 18:23:29 -0000
@@ -28,9 +28,9 @@
 
 int
 _DEFUN (vsnprintf, (str, size, fmt, ap),
-     char *str _AND
+     char *__restrict str _AND
      size_t size _AND
-     _CONST char *fmt _AND
+     _CONST char *__restrict fmt _AND
      va_list ap)
 {
   c99_vsnprintf_t args;
Index: newlib/libc/machine/spu/vsprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/vsprintf.c,v
retrieving revision 1.5
diff -u -r1.5 vsprintf.c
--- newlib/libc/machine/spu/vsprintf.c	23 May 2007 21:41:17 -0000	1.5
+++ newlib/libc/machine/spu/vsprintf.c	15 Nov 2013 18:23:29 -0000
@@ -27,8 +27,8 @@
 
 int
 _DEFUN (vsprintf, (str, fmt, ap),
-     char *str _AND
-     _CONST char *fmt _AND
+     char *__restrict str _AND
+     _CONST char *__restrict fmt _AND
      va_list ap)
 {
   c99_vsprintf_t args;
Index: newlib/libc/machine/spu/vsscanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/vsscanf.c,v
retrieving revision 1.4
diff -u -r1.4 vsscanf.c
--- newlib/libc/machine/spu/vsscanf.c	23 May 2007 21:41:17 -0000	1.4
+++ newlib/libc/machine/spu/vsscanf.c	15 Nov 2013 18:23:29 -0000
@@ -58,8 +58,8 @@
 
 int
 _DEFUN (vsscanf, (str, fmt, ap),
-    _CONST char *str _AND
-    _CONST char *fmt _AND
+    _CONST char *__restrict str _AND
+    _CONST char *__restrict fmt _AND
     va_list ap)
 {
   c99_vsscanf_t args;
Index: newlib/libc/stdio/asnprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/asnprintf.c,v
retrieving revision 1.4
diff -u -r1.4 asnprintf.c
--- newlib/libc/stdio/asnprintf.c	24 Nov 2008 22:08:02 -0000	1.4
+++ newlib/libc/stdio/asnprintf.c	15 Nov 2013 18:23:29 -0000
@@ -15,10 +15,10 @@
 
 char *
 _DEFUN(_asnprintf_r, (ptr, buf, lenp, fmt),
-       struct _reent *ptr _AND
+       struct _reent *__restrict ptr _AND
        char *buf _AND
        size_t *lenp _AND
-       const char *fmt _DOTS)
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
@@ -62,9 +62,9 @@
 
 char *
 _DEFUN(asnprintf, (buf, lenp, fmt),
-       char *buf _AND
-       size_t *lenp _AND
-       const char *fmt _DOTS)
+       char *__restrict buf _AND
+       size_t *__restrict lenp _AND
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
Index: newlib/libc/stdio/asprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/asprintf.c,v
retrieving revision 1.10
diff -u -r1.10 asprintf.c
--- newlib/libc/stdio/asprintf.c	8 Aug 2012 11:04:17 -0000	1.10
+++ newlib/libc/stdio/asprintf.c	15 Nov 2013 18:23:29 -0000
@@ -27,8 +27,8 @@
 int
 _DEFUN(_asprintf_r, (ptr, strp, fmt),
        struct _reent *ptr _AND
-       char **strp        _AND
-       const char *fmt _DOTS)
+       char **__restrict strp        _AND
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
@@ -54,8 +54,8 @@
 
 int
 _DEFUN(asprintf, (strp, fmt),
-       char **strp _AND
-       const char *fmt _DOTS)
+       char **__restrict strp _AND
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
Index: newlib/libc/stdio/dprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/dprintf.c,v
retrieving revision 1.5
diff -u -r1.5 dprintf.c
--- newlib/libc/stdio/dprintf.c	31 Oct 2008 21:08:03 -0000	1.5
+++ newlib/libc/stdio/dprintf.c	15 Nov 2013 18:23:29 -0000
@@ -19,12 +19,13 @@
 ANSI_SYNOPSIS
 	#include <stdio.h>
 	#include <stdarg.h>
-	int dprintf(int <[fd]>, const char *<[format]>, ...);
-	int vdprintf(int <[fd]>, const char *<[format]>, va_list <[ap]>);
+	int dprintf(int <[fd]>, const char *restrict <[format]>, ...);
+	int vdprintf(int <[fd]>, const char *restrict <[format]>,
+			va_list <[ap]>);
 	int _dprintf_r(struct _reent *<[ptr]>, int <[fd]>,
-			const char *<[format]>, ...);
+			const char *restrict <[format]>, ...);
 	int _vdprintf_r(struct _reent *<[ptr]>, int <[fd]>,
-			const char *<[format]>, va_list <[ap]>);
+			const char *restrict <[format]>, va_list <[ap]>);
 
 DESCRIPTION
 <<dprintf>> and <<vdprintf>> allow printing a format, similarly to
@@ -55,7 +56,7 @@
 _DEFUN(_dprintf_r, (ptr, fd, format),
        struct _reent *ptr _AND
        int fd _AND
-       const char *format _DOTS)
+       const char *__restrict format _DOTS)
 {
 	va_list ap;
 	int n;
@@ -71,7 +72,7 @@
 int
 _DEFUN(dprintf, (fd, format),
        int fd _AND
-       const char *format _DOTS)
+       const char *__restrict format _DOTS)
 {
   va_list ap;
   int n;
Index: newlib/libc/stdio/fgetpos.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fgetpos.c,v
retrieving revision 1.6
diff -u -r1.6 fgetpos.c
--- newlib/libc/stdio/fgetpos.c	8 Feb 2005 01:33:16 -0000	1.6
+++ newlib/libc/stdio/fgetpos.c	15 Nov 2013 18:23:29 -0000
@@ -26,8 +26,8 @@
 
 ANSI_SYNOPSIS
 	#include <stdio.h>
-	int fgetpos(FILE *<[fp]>, fpos_t *<[pos]>);
-	int _fgetpos_r(struct _reent *<[ptr]>, FILE *<[fp]>, fpos_t *<[pos]>);
+	int fgetpos(FILE *restrict <[fp]>, fpos_t *restrict <[pos]>);
+	int _fgetpos_r(struct _reent *<[ptr]>, FILE *restrict <[fp]>, fpos_t *restrict <[pos]>);
 
 TRAD_SYNOPSIS
 	#include <stdio.h>
@@ -78,8 +78,8 @@
 int
 _DEFUN(_fgetpos_r, (ptr, fp, pos),
        struct _reent * ptr _AND
-       FILE * fp           _AND
-       _fpos_t * pos)
+       FILE *__restrict fp           _AND
+       _fpos_t *__restrict pos)
 {
   *pos = _ftell_r (ptr, fp);
 
@@ -94,8 +94,8 @@
 
 int
 _DEFUN(fgetpos, (fp, pos),
-       FILE * fp _AND
-       _fpos_t * pos)
+       FILE *__restrict fp _AND
+       _fpos_t *__restrict pos)
 {
   return _fgetpos_r (_REENT, fp, pos);
 }
Index: newlib/libc/stdio/fgets.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fgets.c,v
retrieving revision 1.11
diff -u -r1.11 fgets.c
--- newlib/libc/stdio/fgets.c	10 Aug 2012 15:21:57 -0000	1.11
+++ newlib/libc/stdio/fgets.c	15 Nov 2013 18:23:29 -0000
@@ -26,10 +26,10 @@
 
 ANSI_SYNOPSIS
         #include <stdio.h>
-	char *fgets(char *<[buf]>, int <[n]>, FILE *<[fp]>);
+	char *fgets(char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
 
         #include <stdio.h>
-	char *_fgets_r(struct _reent *<[ptr]>, char *<[buf]>, int <[n]>, FILE *<[fp]>);
+	char *_fgets_r(struct _reent *<[ptr]>, char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
 
 TRAD_SYNOPSIS
 	#include <stdio.h>
@@ -83,9 +83,9 @@
 char *
 _DEFUN(_fgets_r, (ptr, buf, n, fp),
        struct _reent * ptr _AND
-       char *buf _AND
+       char *__restrict buf _AND
        int n     _AND
-       FILE * fp)
+       FILE *__restrict fp)
 {
   size_t len;
   char *s;
@@ -177,9 +177,9 @@
 
 char *
 _DEFUN(fgets, (buf, n, fp),
-       char *buf _AND
+       char *__restrict buf _AND
        int n     _AND
-       FILE * fp)
+       FILE *__restrict fp)
 {
   return _fgets_r (_REENT, buf, n, fp);
 }
Index: newlib/libc/stdio/fmemopen.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fmemopen.c,v
retrieving revision 1.4
diff -u -r1.4 fmemopen.c
--- newlib/libc/stdio/fmemopen.c	23 Oct 2013 10:04:43 -0000	1.4
+++ newlib/libc/stdio/fmemopen.c	15 Nov 2013 18:23:29 -0000
@@ -270,9 +270,9 @@
 FILE *
 _DEFUN(_fmemopen_r, (ptr, buf, size, mode),
        struct _reent *ptr _AND
-       void *buf _AND
+       void *__restrict buf _AND
        size_t size _AND
-       const char *mode)
+       const char *__restrict mode)
 {
   FILE *fp;
   fmemcookie *c;
@@ -362,9 +362,9 @@
 #ifndef _REENT_ONLY
 FILE *
 _DEFUN(fmemopen, (buf, size, mode),
-       void *buf _AND
+       void *__restrict buf _AND
        size_t size _AND
-       const char *mode)
+       const char *__restrict mode)
 {
   return _fmemopen_r (_REENT, buf, size, mode);
 }
Index: newlib/libc/stdio/fopen.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fopen.c,v
retrieving revision 1.10
diff -u -r1.10 fopen.c
--- newlib/libc/stdio/fopen.c	30 May 2012 08:58:42 -0000	1.10
+++ newlib/libc/stdio/fopen.c	15 Nov 2013 18:23:29 -0000
@@ -126,8 +126,8 @@
 FILE *
 _DEFUN(_fopen_r, (ptr, file, mode),
        struct _reent *ptr _AND
-       _CONST char *file _AND
-       _CONST char *mode)
+       _CONST char *__restrict file _AND
+       _CONST char *__restrict mode)
 {
   register FILE *fp;
   register int f;
Index: newlib/libc/stdio/fprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fprintf.c,v
retrieving revision 1.5
diff -u -r1.5 fprintf.c
--- newlib/libc/stdio/fprintf.c	4 May 2007 02:55:16 -0000	1.5
+++ newlib/libc/stdio/fprintf.c	15 Nov 2013 18:23:29 -0000
@@ -24,8 +24,8 @@
 int
 _DEFUN(_fprintf_r, (ptr, fp, fmt),
        struct _reent *ptr _AND
-       FILE *fp _AND
-       const char *fmt _DOTS)
+       FILE *__restrict fp _AND
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
@@ -40,8 +40,8 @@
 
 int
 _DEFUN(fprintf, (fp, fmt),
-       FILE *fp _AND
-       const char *fmt _DOTS)
+       FILE *__restrict fp _AND
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
Index: newlib/libc/stdio/fputs.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fputs.c,v
retrieving revision 1.9
diff -u -r1.9 fputs.c
--- newlib/libc/stdio/fputs.c	27 Mar 2013 09:38:39 -0000	1.9
+++ newlib/libc/stdio/fputs.c	15 Nov 2013 18:23:29 -0000
@@ -26,10 +26,10 @@
 
 ANSI_SYNOPSIS
 	#include <stdio.h>
-	int fputs(const char *<[s]>, FILE *<[fp]>);
+	int fputs(const char *restrict <[s]>, FILE *restrict <[fp]>);
 
 	#include <stdio.h>
-	int _fputs_r(struct _reent *<[ptr]>, const char *<[s]>, FILE *<[fp]>);
+	int _fputs_r(struct _reent *<[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>);
 
 TRAD_SYNOPSIS
 	#include <stdio.h>
@@ -74,8 +74,8 @@
 int
 _DEFUN(_fputs_r, (ptr, s, fp),
        struct _reent * ptr _AND
-       char _CONST * s _AND
-       FILE * fp)
+       char _CONST *__restrict s _AND
+       FILE *__restrict fp)
 {
 #ifdef _FVWRITE_IN_STREAMIO
   int result;
@@ -122,8 +122,8 @@
 #ifndef _REENT_ONLY
 int
 _DEFUN(fputs, (s, fp),
-       char _CONST * s _AND
-       FILE * fp)
+       char _CONST *__restrict s _AND
+       FILE *__restrict fp)
 {
   return _fputs_r (_REENT, s, fp);
 }
Index: newlib/libc/stdio/fread.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fread.c,v
retrieving revision 1.21
diff -u -r1.21 fread.c
--- newlib/libc/stdio/fread.c	30 May 2012 08:58:42 -0000	1.21
+++ newlib/libc/stdio/fread.c	15 Nov 2013 18:23:29 -0000
@@ -26,12 +26,12 @@
 
 ANSI_SYNOPSIS
 	#include <stdio.h>
-	size_t fread(void *<[buf]>, size_t <[size]>, size_t <[count]>,
-		     FILE *<[fp]>);
+	size_t fread(void *restrict <[buf]>, size_t <[size]>, size_t <[count]>,
+		     FILE *restrict <[fp]>);
 
 	#include <stdio.h>
-	size_t _fread_r(struct _reent *<[ptr]>, void *<[buf]>,
-	                size_t <[size]>, size_t <[count]>, FILE *<[fp]>);
+	size_t _fread_r(struct _reent *<[ptr]>, void *restrict <[buf]>,
+	                size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>);
 
 TRAD_SYNOPSIS
 	#include <stdio.h>
@@ -131,10 +131,10 @@
 size_t
 _DEFUN(_fread_r, (ptr, buf, size, count, fp),
        struct _reent * ptr _AND
-       _PTR buf _AND
+       _PTR __restrict buf _AND
        size_t size _AND
        size_t count _AND
-       FILE * fp)
+       FILE * __restrict fp)
 {
   register size_t resid;
   register char *p;
@@ -248,10 +248,10 @@
 #ifndef _REENT_ONLY
 size_t
 _DEFUN(fread, (buf, size, count, fp),
-       _PTR buf _AND
+       _PTR __restrict  buf _AND
        size_t size _AND
        size_t count _AND
-       FILE * fp)
+       FILE *__restrict fp)
 {
    return _fread_r (_REENT, buf, size, count, fp);
 }
Index: newlib/libc/stdio/freopen.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/freopen.c,v
retrieving revision 1.28
diff -u -r1.28 freopen.c
--- newlib/libc/stdio/freopen.c	26 Mar 2013 16:07:55 -0000	1.28
+++ newlib/libc/stdio/freopen.c	15 Nov 2013 18:23:29 -0000
@@ -26,10 +26,10 @@
 
 ANSI_SYNOPSIS
 	#include <stdio.h>
-	FILE *freopen(const char *<[file]>, const char *<[mode]>,
-		      FILE *<[fp]>);
-	FILE *_freopen_r(struct _reent *<[ptr]>, const char *<[file]>,
-		      const char *<[mode]>, FILE *<[fp]>);
+	FILE *freopen(const char *restrict <[file]>, const char *restrict <[mode]>,
+		      FILE *restrict <[fp]>);
+	FILE *_freopen_r(struct _reent *<[ptr]>, const char *restrict <[file]>,
+		      const char *restrict <[mode]>, FILE *restrict <[fp]>);
 
 TRAD_SYNOPSIS
 	#include <stdio.h>
@@ -90,9 +90,9 @@
 FILE *
 _DEFUN(_freopen_r, (ptr, file, mode, fp),
        struct _reent *ptr _AND
-       const char *file _AND
-       const char *mode _AND
-       register FILE *fp)
+       const char *__restrict file _AND
+       const char *__restrict mode _AND
+       register FILE *__restrict fp)
 {
   register int f;
   int flags, oflags;
@@ -252,9 +252,9 @@
 
 FILE *
 _DEFUN(freopen, (file, mode, fp),
-       _CONST char *file _AND
-       _CONST char *mode _AND
-       register FILE *fp)
+       _CONST char *__restrict file _AND
+       _CONST char *__restrict mode _AND
+       register FILE *__restrict fp)
 {
   return _freopen_r (_REENT, file, mode, fp);
 }
Index: newlib/libc/stdio/fscanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fscanf.c,v
retrieving revision 1.4
diff -u -r1.4 fscanf.c
--- newlib/libc/stdio/fscanf.c	15 Jul 2011 08:04:17 -0000	1.4
+++ newlib/libc/stdio/fscanf.c	15 Nov 2013 18:23:29 -0000
@@ -29,7 +29,7 @@
 
 int
 #ifdef _HAVE_STDC
-fscanf(FILE *fp, _CONST char *fmt, ...)
+fscanf(FILE *__restrict fp, _CONST char *__restrict fmt, ...)
 #else
 fscanf(FILE *fp, fmt, va_alist)
        FILE *fp;
@@ -54,7 +54,7 @@
 
 int
 #ifdef _HAVE_STDC
-_fscanf_r(struct _reent *ptr, FILE *fp, _CONST char *fmt, ...)
+_fscanf_r(struct _reent *ptr, FILE *__restrict fp, _CONST char *__restrict fmt, ...)
 #else
 _fscanf_r(ptr, FILE *fp, fmt, va_alist)
           struct _reent *ptr;
Index: newlib/libc/stdio/fwrite.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/fwrite.c,v
retrieving revision 1.10
diff -u -r1.10 fwrite.c
--- newlib/libc/stdio/fwrite.c	27 Mar 2013 09:38:39 -0000	1.10
+++ newlib/libc/stdio/fwrite.c	15 Nov 2013 18:23:29 -0000
@@ -26,12 +26,12 @@
 
 ANSI_SYNOPSIS
 	#include <stdio.h>
-	size_t fwrite(const void *<[buf]>, size_t <[size]>,
-		      size_t <[count]>, FILE *<[fp]>);
+	size_t fwrite(const void *restrict <[buf]>, size_t <[size]>,
+		      size_t <[count]>, FILE *restrict <[fp]>);
 
 	#include <stdio.h>
-	size_t _fwrite_r(struct _reent *<[ptr]>, const void *<[buf]>, size_t <[size]>,
-		      size_t <[count]>, FILE *<[fp]>);
+	size_t _fwrite_r(struct _reent *<[ptr]>, const void *restrict <[buf]>, size_t <[size]>,
+		      size_t <[count]>, FILE *restrict <[fp]>);
 
 TRAD_SYNOPSIS
 	#include <stdio.h>
@@ -97,10 +97,10 @@
 size_t
 _DEFUN(_fwrite_r, (ptr, buf, size, count, fp),
        struct _reent * ptr _AND
-       _CONST _PTR buf _AND
+       _CONST _PTR __restrict buf _AND
        size_t size     _AND
        size_t count    _AND
-       FILE * fp)
+       FILE * __restrict fp)
 {
   size_t n;
 #ifdef _FVWRITE_IN_STREAMIO
@@ -158,7 +158,7 @@
 #ifndef _REENT_ONLY
 size_t
 _DEFUN(fwrite, (buf, size, count, fp),
-       _CONST _PTR buf _AND
+       _CONST _PTR __restrict buf _AND
        size_t size     _AND
        size_t count    _AND
        FILE * fp)
Index: newlib/libc/stdio/printf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/printf.c,v
retrieving revision 1.7
diff -u -r1.7 printf.c
--- newlib/libc/stdio/printf.c	4 May 2007 02:55:16 -0000	1.7
+++ newlib/libc/stdio/printf.c	15 Nov 2013 18:23:29 -0000
@@ -25,7 +25,7 @@
 int
 _DEFUN(_printf_r, (ptr, fmt),
        struct _reent *ptr _AND
-       const char *fmt _DOTS)
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
@@ -41,7 +41,7 @@
 
 int
 _DEFUN(printf, (fmt),
-       const char *fmt _DOTS)
+       const char *__restrict fmt _DOTS)
 {
   int ret;
   va_list ap;
Index: newlib/libc/stdio/scanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/scanf.c,v
retrieving revision 1.8
diff -u -r1.8 scanf.c
--- newlib/libc/stdio/scanf.c	29 Apr 2013 21:06:23 -0000	1.8
+++ newlib/libc/stdio/scanf.c	15 Nov 2013 18:23:29 -0000
@@ -29,7 +29,7 @@
 
 int
 #ifdef _HAVE_STDC
-scanf(_CONST char *fmt, ...)
+scanf(_CONST char *__restrict fmt, ...)
 #else
 scanf(fmt, va_alist)
       char *fmt;
@@ -55,7 +55,7 @@
 
 int
 #ifdef _HAVE_STDC
-_scanf_r(struct _reent *ptr, _CONST char *fmt, ...)
+_scanf_r(struct _reent *ptr, _CONST char *__restrict fmt, ...)
 #else
 _scanf_r(ptr, fmt, va_alist)
          struct _reent *ptr;
Index: newlib/libc/stdio/setbuf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/setbuf.c,v
retrieving revision 1.2
diff -u -r1.2 setbuf.c
--- newlib/libc/stdio/setbuf.c	23 Apr 2004 20:01:55 -0000	1.2
+++ newlib/libc/stdio/setbuf.c	15 Nov 2013 18:23:29 -0000
@@ -72,8 +72,8 @@
 
 _VOID
 _DEFUN(setbuf, (fp, buf),
-       FILE * fp _AND
-       char *buf)
+       FILE *__restrict fp _AND
+       char *__restrict buf)
 {
   _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
 }
Index: newlib/libc/stdio/snprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/snprintf.c,v
retrieving revision 1.7
diff -u -r1.7 snprintf.c
--- newlib/libc/stdio/snprintf.c	14 Apr 2008 21:14:55 -0000	1.7
+++ newlib/libc/stdio/snprintf.c	15 Nov 2013 18:23:29 -0000
@@ -33,9 +33,9 @@
 #ifdef _HAVE_STDC
 _DEFUN(_snprintf_r, (ptr, str, size, fmt),
        struct _reent *ptr _AND
-       char *str          _AND
+       char *__restrict str          _AND
        size_t size        _AND
-       _CONST char *fmt _DOTS)
+       _CONST char *__restrict fmt _DOTS)
 #else
 _snprintf_r(ptr, str, size, fmt, va_alist)
             struct _reent *ptr;
@@ -77,9 +77,9 @@
 int
 #ifdef _HAVE_STDC
 _DEFUN(snprintf, (str, size, fmt),
-       char *str   _AND
+       char *__restrict str _AND
        size_t size _AND
-       _CONST char *fmt _DOTS)
+       _CONST char *__restrict fmt _DOTS)
 #else
 snprintf(str, size, fmt, va_alist)
          char *str;
Index: newlib/libc/stdio/sprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/sprintf.c,v
retrieving revision 1.15
diff -u -r1.15 sprintf.c
--- newlib/libc/stdio/sprintf.c	13 Jan 2012 09:13:56 -0000	1.15
+++ newlib/libc/stdio/sprintf.c	15 Nov 2013 18:23:29 -0000
@@ -47,26 +47,26 @@
 ANSI_SYNOPSIS
         #include <stdio.h>
 
-        int printf(const char *<[format]>, ...);
-        int fprintf(FILE *<[fd]>, const char *<[format]>, ...);
-        int sprintf(char *<[str]>, const char *<[format]>, ...);
-        int snprintf(char *<[str]>, size_t <[size]>, const char *<[format]>,
+        int printf(const char *restrict <[format]>, ...);
+        int fprintf(FILE *restrict <[fd]>, const char *restrict <[format]>, ...);
+        int sprintf(char *restrict <[str]>, const char *restrict <[format]>, ...);
+        int snprintf(char *restrict <[str]>, size_t <[size]>, const char *restrict <[format]>,
                      ...);
-        int asprintf(char **<[strp]>, const char *<[format]>, ...);
-        char *asnprintf(char *<[str]>, size_t *<[size]>, const char *<[format]>,
+        int asprintf(char **restrict <[strp]>, const char *restrict <[format]>, ...);
+        char *asnprintf(char *restrict <[str]>, size_t *restrict <[size]>, const char *restrict <[format]>,
                         ...);
 
-        int _printf_r(struct _reent *<[ptr]>, const char *<[format]>, ...);
-        int _fprintf_r(struct _reent *<[ptr]>, FILE *<[fd]>,
-                       const char *<[format]>, ...);
-        int _sprintf_r(struct _reent *<[ptr]>, char *<[str]>,
-                       const char *<[format]>, ...);
-        int _snprintf_r(struct _reent *<[ptr]>, char *<[str]>, size_t <[size]>,
-                        const char *<[format]>, ...);
-        int _asprintf_r(struct _reent *<[ptr]>, char **<[strp]>,
-                        const char *<[format]>, ...);
-        char *_asnprintf_r(struct _reent *<[ptr]>, char *<[str]>,
-                           size_t *<[size]>, const char *<[format]>, ...);
+        int _printf_r(struct _reent *<[ptr]>, const char *restrict <[format]>, ...);
+        int _fprintf_r(struct _reent *<[ptr]>, FILE *restrict <[fd]>,
+                       const char *restrict <[format]>, ...);
+        int _sprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>,
+                       const char *restrict <[format]>, ...);
+        int _snprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>, size_t <[size]>,
+                        const char *restrict <[format]>, ...);
+        int _asprintf_r(struct _reent *<[ptr]>, char **restrict <[strp]>,
+                        const char *restrict <[format]>, ...);
+        char *_asnprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>,
+                           size_t *restrict <[size]>, const char *restrict <[format]>, ...);
 
 DESCRIPTION
         <<printf>> accepts a series of arguments, applies to each a
@@ -579,13 +579,13 @@
 #ifdef _HAVE_STDC
 _DEFUN(_sprintf_r, (ptr, str, fmt),
        struct _reent *ptr _AND
-       char *str          _AND
-       _CONST char *fmt _DOTS)
+       char *__restrict str          _AND
+       _CONST char *__restrict fmt _DOTS)
 #else
 _sprintf_r(ptr, str, fmt, va_alist)
            struct _reent *ptr;
-           char *str;
-           _CONST char *fmt;
+           char *__restrict str;
+           _CONST char *__restrict fmt;
            va_dcl
 #endif
 {
@@ -613,8 +613,8 @@
 int
 #ifdef _HAVE_STDC
 _DEFUN(sprintf, (str, fmt),
-       char *str _AND
-       _CONST char *fmt _DOTS)
+       char *__restrict str _AND
+       _CONST char *__restrict fmt _DOTS)
 #else
 sprintf(str, fmt, va_alist)
         char *str;
Index: newlib/libc/stdio/sscanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/sscanf.c,v
retrieving revision 1.15
diff -u -r1.15 sscanf.c
--- newlib/libc/stdio/sscanf.c	11 Mar 2009 11:53:22 -0000	1.15
+++ newlib/libc/stdio/sscanf.c	15 Nov 2013 18:23:29 -0000
@@ -35,15 +35,15 @@
 ANSI_SYNOPSIS
         #include <stdio.h>
 
-        int scanf(const char *<[format]>, ...);
-        int fscanf(FILE *<[fd]>, const char *<[format]>, ...);
-        int sscanf(const char *<[str]>, const char *<[format]>, ...);
-
-        int _scanf_r(struct _reent *<[ptr]>, const char *<[format]>, ...);
-        int _fscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>, 
-                      const char *<[format]>, ...);
-        int _sscanf_r(struct _reent *<[ptr]>, const char *<[str]>,
-                      const char *<[format]>, ...);
+        int scanf(const char *restrict <[format]>, ...);
+        int fscanf(FILE *restrict <[fd]>, const char *restrict <[format]>, ...);
+        int sscanf(const char *restrict <[str]>, const char *restrict <[format]>, ...);
+
+        int _scanf_r(struct _reent *<[ptr]>, const char *restrict <[format]>, ...);
+        int _fscanf_r(struct _reent *<[ptr]>, FILE *restrict <[fd]>, 
+                      const char *restrict <[format]>, ...);
+        int _sscanf_r(struct _reent *<[ptr]>, const char *restrict <[str]>,
+                      const char *restrict <[format]>, ...);
 
 
 TRAD_SYNOPSIS
@@ -399,8 +399,8 @@
 #ifdef _HAVE_STDC
 int 
 _DEFUN(sscanf, (str, fmt),
-       _CONST char *str _AND
-       _CONST char *fmt _DOTS)
+       _CONST char *__restrict str _AND
+       _CONST char * fmt _DOTS)
 #else
 int 
 sscanf(str, fmt, va_alist)
@@ -436,14 +436,14 @@
 int 
 _DEFUN(_sscanf_r, (ptr, str, fmt), 
        struct _reent *ptr _AND
-       _CONST char *str   _AND
-       _CONST char *fmt _DOTS)
+       _CONST char *__restrict str   _AND
+       _CONST char *__restrict fmt _DOTS)
 #else
 int 
 _sscanf_r(ptr, str, fmt, va_alist)
           struct _reent *ptr;
-          _CONST char *str;
-          _CONST char *fmt;
+          _CONST char *__restrict str;
+          _CONST char *__restrict fmt;
           va_dcl
 #endif
 {
Index: newlib/libc/stdio/vdprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/vdprintf.c,v
retrieving revision 1.4
diff -u -r1.4 vdprintf.c
--- newlib/libc/stdio/vdprintf.c	7 Mar 2008 16:45:04 -0000	1.4
+++ newlib/libc/stdio/vdprintf.c	15 Nov 2013 18:23:29 -0000
@@ -16,7 +16,7 @@
 _DEFUN(_vdprintf_r, (ptr, fd, format, ap),
        struct _reent *ptr _AND
        int fd _AND
-       const char *format _AND
+       const char *__restrict format _AND
        va_list ap)
 {
   char *p;
@@ -38,7 +38,7 @@
 int
 _DEFUN(vdprintf, (fd, format, ap),
        int fd _AND
-       const char *format _AND
+       const char *__restrict format _AND
        va_list ap)
 {
   return _vdprintf_r (_REENT, fd, format, ap);
Index: newlib/libc/stdio/vprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/vprintf.c,v
retrieving revision 1.7
diff -u -r1.7 vprintf.c
--- newlib/libc/stdio/vprintf.c	29 Apr 2013 21:06:23 -0000	1.7
+++ newlib/libc/stdio/vprintf.c	15 Nov 2013 18:23:29 -0000
@@ -44,7 +44,7 @@
 int
 _DEFUN(_vprintf_r, (ptr, fmt, ap),
        struct _reent *ptr _AND
-       _CONST char *fmt   _AND
+       _CONST char *__restrict fmt   _AND
        va_list ap)
 {
   _REENT_SMALL_CHECK_INIT (ptr);
Index: newlib/libc/stdio/vscanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/vscanf.c,v
retrieving revision 1.5
diff -u -r1.5 vscanf.c
--- newlib/libc/stdio/vscanf.c	29 Apr 2013 21:06:23 -0000	1.5
+++ newlib/libc/stdio/vscanf.c	15 Nov 2013 18:23:29 -0000
@@ -45,7 +45,7 @@
 int
 _DEFUN(_vscanf_r, (ptr, fmt, ap),
        struct _reent *ptr _AND 
-       _CONST char *fmt   _AND 
+       _CONST char *__restrict fmt   _AND 
        va_list ap)
 {
   _REENT_SMALL_CHECK_INIT (ptr);
Index: newlib/libc/stdio/vsnprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/vsnprintf.c,v
retrieving revision 1.10
diff -u -r1.10 vsnprintf.c
--- newlib/libc/stdio/vsnprintf.c	19 Aug 2011 17:00:32 -0000	1.10
+++ newlib/libc/stdio/vsnprintf.c	15 Nov 2013 18:23:29 -0000
@@ -33,9 +33,9 @@
 
 int
 _DEFUN(vsnprintf, (str, size, fmt, ap),
-       char *str        _AND
+       char *__restrict str        _AND
        size_t size      _AND
-       const char *fmt _AND
+       const char *__restrict fmt _AND
        va_list ap)
 {
   return _vsnprintf_r (_REENT, str, size, fmt, ap);
@@ -46,9 +46,9 @@
 int
 _DEFUN(_vsnprintf_r, (ptr, str, size, fmt, ap),
        struct _reent *ptr _AND
-       char *str          _AND
+       char *__restrict str          _AND
        size_t size        _AND
-       const char *fmt   _AND
+       const char *__restrict fmt   _AND
        va_list ap)
 {
   int ret;
Index: newlib/libc/stdio/vsprintf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/vsprintf.c,v
retrieving revision 1.8
diff -u -r1.8 vsprintf.c
--- newlib/libc/stdio/vsprintf.c	19 Aug 2011 17:00:32 -0000	1.8
+++ newlib/libc/stdio/vsprintf.c	15 Nov 2013 18:23:29 -0000
@@ -32,8 +32,8 @@
 
 int
 _DEFUN(vsprintf, (str, fmt, ap),
-       char *str        _AND
-       const char *fmt _AND
+       char *__restrict str        _AND
+       const char *__restrict fmt _AND
        va_list ap)
 {
   return _vsprintf_r (_REENT, str, fmt, ap);
@@ -44,8 +44,8 @@
 int
 _DEFUN(_vsprintf_r, (ptr, str, fmt, ap),
        struct _reent *ptr _AND
-       char *str          _AND
-       const char *fmt   _AND
+       char *__restrict str          _AND
+       const char *__restrict fmt   _AND
        va_list ap)
 {
   int ret;
Index: newlib/libc/stdio/vsscanf.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/vsscanf.c,v
retrieving revision 1.7
diff -u -r1.7 vsscanf.c
--- newlib/libc/stdio/vsscanf.c	11 Mar 2009 11:53:22 -0000	1.7
+++ newlib/libc/stdio/vsscanf.c	15 Nov 2013 18:23:29 -0000
@@ -36,8 +36,8 @@
 
 int
 _DEFUN(vsscanf, (str, fmt, ap), 
-       _CONST char *str _AND 
-       _CONST char *fmt _AND 
+       _CONST char *__restrict str _AND 
+       _CONST char *__restrict fmt _AND 
        va_list ap)
 {
   return _vsscanf_r (_REENT, str, fmt, ap);
@@ -48,8 +48,8 @@
 int
 _DEFUN(_vsscanf_r, (ptr, str, fmt, ap),
        struct _reent *ptr _AND 
-       _CONST char *str   _AND 
-       _CONST char *fmt   _AND 
+       _CONST char *__restrict str   _AND 
+       _CONST char *__restrict fmt   _AND 
        va_list ap)
 {
   FILE f;


More information about the Newlib mailing list