summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog28
-rw-r--r--Rules35
-rw-r--r--argp/argp.h6
-rw-r--r--io/sys/stat.h28
-rw-r--r--libio/stdio.h22
-rw-r--r--misc/sys/cdefs.h5
-rw-r--r--stdio/stdio.h24
-rw-r--r--stdlib/stdlib.h38
-rw-r--r--string/argz.h6
-rw-r--r--sysdeps/unix/opendir.c19
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c1
-rw-r--r--sysdeps/wordsize-32/inttypes.h16
-rw-r--r--sysdeps/wordsize-64/inttypes.h16
-rw-r--r--wcsmbs/wchar.h45
15 files changed, 163 insertions, 128 deletions
diff --git a/ChangeLog b/ChangeLog
index 29f44647db..f22bb5c931 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+1998-10-13  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Include
+	string.h to get memcpy prototype and NULL definition.
+
+1998-10-12  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* misc/sys/cdefs.h (__THROW): New macro.
+	* argp/argp.h: Use it to replace the kludgey __P in inline
+	function definitions.
+	* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
+	* stdlib/stdlib.h: Likewise.
+	* wcsmbs/wchar.h: Likewise.
+	* libio/stdio.h: Likewise.
+	* stdio/stdio.h: Likewise.
+	* sysdeps/wordsize-64/inttypes.h: Likewise.
+	* sysdeps/wordsize-32/inttypes.h: Likewise.
+	* string/argz.h: Likewise.
+	* io/sys/stat.h: Likewise.
+
+1998-10-12  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* Rules (stdio_lim): New variable.
+	($(stdio_lim:h=st)): Use this as intermediate stamp file, depend
+	on Rules and config.make, use $(move-if-change) to avoid unnessary
+	recompilations, and cleanup command.
+	(common-generated): Add bits/stdio_lim.st.
+
 1998-10-12  Ulrich Drepper  <drepper@cygnus.com>
 
 	* sysdeps/unix/sysv/linux/alpha/Makefile (CFLAGS-ioperm.c): New
diff --git a/Rules b/Rules
index f44ae91323..5f45413aa7 100644
--- a/Rules
+++ b/Rules
@@ -214,19 +214,23 @@ TMP_MAX   = 238328
 L_ctermid = 9
 L_cuserid = 9
 endif
+stdio_lim = $(common-objpfx)bits/stdio_lim.h
 
-$(common-objpfx)bits/stdio_%.h $(common-objpfx)bits/stdio_%.d: 		\
-			$(..)stdio-common/stdio_%.h.in
+$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @:
+$(stdio_lim:h=st): $(..)stdio-common/stdio_lim.h.in $(..)Rules \
+		   $(common-objpfx)config.make
 	$(make-target-directory)
 	echo '#include "$(..)posix/bits/posix1_lim.h"' |		\
-	SUNPRO_DEPENDENCIES='$(@:.h=.d)T MARKER' 			\
-	$(CC) $(+includes) -E -dM -xc - -o $(@:.d=.h)T
-	sed -e 's!MARKER!$(@:.h=.d) $(@:.d=.h)!'			\
-	    -e 's!$(common-objpfx)!$$(common-objpfx)!g'			\
-		$(@:.h=.d)T > $(@:.h=.d)t
-	mv -f $(@:.h=.d)t $(@:.h=.d)
-	fopen_max=`sed -n 's/^#define OPEN_MAX //p' $(@:.d=.h)T`; 	\
-	filename_max=`sed -n 's/^#define PATH_MAX //p' $(@:.d=.h)T`;	\
+	SUNPRO_DEPENDENCIES='$(@:st=dT) $@'				\
+	$(CC) $(+includes) -E -dM -xc - -o $(@:st=hT)
+ifdef sed-remove-objpfx
+	sed $(sed-remove-objpfx) $(@:st=dT) > $(@:st=dt)
+	mv -f $(@:st=dt) $(@:st=d)
+else
+	mv -f $(@:st=dT) $(@:st=d)
+endif
+	fopen_max=`sed -n 's/^#define OPEN_MAX //p' $(@:st=hT)`; 	\
+	filename_max=`sed -n 's/^#define PATH_MAX //p' $(@:st=hT)`;	\
 	fopen_max=$${fopen_max:-16};					\
 	filename_max=$${filename_max:-1024};				\
 	sed -e "s/@FOPEN_MAX@/$$fopen_max/"				\
@@ -235,12 +239,13 @@ $(common-objpfx)bits/stdio_%.h $(common-objpfx)bits/stdio_%.d: 		\
 	    -e "s/@TMP_MAX@/$(TMP_MAX)/"				\
 	    -e "s/@L_ctermid@/$(L_ctermid)/"				\
 	    -e "s/@L_cuserid@/$(L_cuserid)/"				\
-	    $< > $(@:.d=.h).new
-	mv -f $(@:.d=.h).new $(@:.d=.h)
+	    $< > $(@:st=h.new)
+	$(move-if-change) $(@:st=h.new) $(@:st=h)
 # Remove these last so that they can be examined if something went wrong.
-	rm -f $(@:.d=.h)T $(@:.h=.d)T
+	rm -f $(@:st=hT) $(@:st=dT)
+	touch $@
 # Get dependencies.
 ifndef no_deps
--include $(common-objpfx)bits/stdio_lim.d
+-include $(stdio_lim:h=d)
 endif
-common-generated += bits/stdio_lim.h bits/stdio_lim.d
+common-generated += bits/stdio_lim.h bits/stdio_lim.d bits/stdio_lim.st
diff --git a/argp/argp.h b/argp/argp.h
index b4ac686393..cc35970afa 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -535,13 +535,13 @@ extern void *__argp_input __P ((__const struct argp *argp,
 # endif
 
 ARGP_EI void
-__argp_usage __P ((__const struct argp_state *__state))
+__argp_usage (__const struct argp_state *__state) __THROW
 {
   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
 }
 
 ARGP_EI int
-__option_is_short __P ((__const struct argp_option *__opt))
+__option_is_short (__const struct argp_option *__opt) __THROW
 {
   if (__opt->flags & OPTION_DOC)
     return 0;
@@ -553,7 +553,7 @@ __option_is_short __P ((__const struct argp_option *__opt))
 }
 
 ARGP_EI int
-__option_is_end __P ((__const struct argp_option *__opt))
+__option_is_end (__const struct argp_option *__opt) __THROW
 {
   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
 }
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 54d5fc709d..8269c4bb0f 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -310,53 +310,51 @@ extern int __xmknod __P ((int __ver, __const char *__path,
 			  __mode_t __mode, __dev_t *__dev));
 
 #if defined __GNUC__ && __GNUC__ >= 2
-/* Inlined versions of the real stat and mknod functions.
+/* Inlined versions of the real stat and mknod functions.  */
 
-   We have to use __P here since we need definitions matching the
-   declarations above.  */
-
-extern __inline__ int stat __P ((__const char *__path, struct stat *__statbuf))
+extern __inline__ int stat (__const char *__path,
+			    struct stat *__statbuf) __THROW
 {
   return __xstat (_STAT_VER, __path, __statbuf);
 }
 
 # if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern __inline__ int lstat __P ((__const char *__path,
-				  struct stat *__statbuf))
+extern __inline__ int lstat (__const char *__path,
+			     struct stat *__statbuf) __THROW
 {
   return __lxstat (_STAT_VER, __path, __statbuf);
 }
 # endif
 
-extern __inline__ int fstat __P ((int __fd, struct stat *__statbuf))
+extern __inline__ int fstat (int __fd, struct stat *__statbuf) __THROW
 {
   return __fxstat (_STAT_VER, __fd, __statbuf);
 }
 
 # if defined __USE_MISC || defined __USE_BSD
-extern __inline__ int mknod __P ((__const char *__path, __mode_t __mode,
-				  __dev_t __dev))
+extern __inline__ int mknod (__const char *__path, __mode_t __mode,
+			     __dev_t __dev) __THROW
 {
   return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
 }
 # endif
 
 # ifdef __USE_LARGEFILE64
-extern __inline__ int stat64 __P ((__const char *__path,
-				   struct stat64 *__statbuf))
+extern __inline__ int stat64 (__const char *__path,
+			      struct stat64 *__statbuf) __THROW
 {
   return __xstat64 (_STAT_VER, __path, __statbuf);
 }
 
 #  if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern __inline__ int lstat64 __P ((__const char *__path,
-				    struct stat64 *__statbuf))
+extern __inline__ int lstat64 (__const char *__path,
+			       struct stat64 *__statbuf) __THROW
 {
   return __lxstat64 (_STAT_VER, __path, __statbuf);
 }
 #  endif
 
-extern __inline__ int fstat64 __P ((int __fd, struct stat64 *__statbuf))
+extern __inline__ int fstat64 (int __fd, struct stat64 *__statbuf) __THROW
 {
   return __fxstat64 (_STAT_VER, __fd, __statbuf);
 }
diff --git a/libio/stdio.h b/libio/stdio.h
index f7677390e5..002cb8baef 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -281,7 +281,7 @@ extern int vsprintf __P ((char *__restrict __s,
 
 #ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE int
-vprintf __P ((__const char *__restrict __fmt, _G_va_list __arg))
+vprintf (__const char *__restrict __fmt, _G_va_list __arg) __THROW
 {
   return vfprintf (stdout, __fmt, __arg);
 }
@@ -366,7 +366,7 @@ extern int getchar __P ((void));
 
 #ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE int
-getchar __P ((void))
+getchar (void) __THROW
 {
   return _IO_getc (stdin);
 }
@@ -379,13 +379,13 @@ extern int getchar_unlocked __P ((void));
 
 # ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE int
-getc_unlocked __P ((FILE *__fp))
+getc_unlocked (FILE *__fp) __THROW
 {
   return _IO_getc_unlocked (__fp);
 }
 
 __STDIO_INLINE int
-getchar_unlocked __P ((void))
+getchar_unlocked (void) __THROW
 {
   return _IO_getc_unlocked (stdin);
 }
@@ -406,7 +406,7 @@ extern int putchar __P ((int __c));
 
 #ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE int
-putchar __P ((int __c))
+putchar (int __c) __THROW
 {
   return _IO_putc (__c, stdout);
 }
@@ -418,7 +418,7 @@ extern int fputc_unlocked __P ((int __c, FILE *__stream));
 
 # ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE int
-fputc_unlocked __P ((int __c, FILE *__stream))
+fputc_unlocked (int __c, FILE *__stream) __THROW
 {
   return _IO_putc_unlocked (__c, __stream);
 }
@@ -432,13 +432,13 @@ extern int putchar_unlocked __P ((int __c));
 
 # ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE int
-putc_unlocked __P ((int __c, FILE *__stream))
+putc_unlocked (int __c, FILE *__stream) __THROW
 {
   return _IO_putc_unlocked (__c, __stream);
 }
 
 __STDIO_INLINE int
-putchar_unlocked __P ((int __c))
+putchar_unlocked (int __c) __THROW
 {
   return _IO_putc_unlocked (__c, stdout);
 }
@@ -487,7 +487,7 @@ extern _IO_ssize_t getline __P ((char **__lineptr, size_t *__n,
 
 # ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE _IO_ssize_t
-getline __P ((char **__lineptr, size_t *__n, FILE *__stream))
+getline (char **__lineptr, size_t *__n, FILE *__stream) __THROW
 {
   return __getdelim (__lineptr, __n, '\n', __stream);
 }
@@ -618,13 +618,13 @@ extern int ferror_unlocked __P ((FILE *__stream));
 
 # ifdef __USE_EXTERN_INLINES
 __STDIO_INLINE int
-feof_unlocked __P ((FILE *__stream))
+feof_unlocked (FILE *__stream) __THROW
 {
   return _IO_feof_unlocked (__stream);
 }
 
 __STDIO_INLINE int
-ferror_unlocked __P ((FILE *__stream))
+ferror_unlocked (FILE *__stream) __THROW
 {
   return _IO_ferror_unlocked (__stream);
 }
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 964b9dfeb9..539cbbc09f 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -30,10 +30,11 @@
    to help it optimize the function calls.  But this works only with
    gcc 2.8.x and egcs.  */
 # if defined __cplusplus && __GNUC_MINOR__ >= 8
-#  define __P(args)	args throw ()
+#  define __THROW	throw ()
 # else
-#  define __P(args)	args
+#  define __THROW
 # endif
+# define __P(args)	args __THROW
 /* This macro will be used for functions which might take C++ callback
    functions.  */
 # define __PMT(args)	args
diff --git a/stdio/stdio.h b/stdio/stdio.h
index 513b079c47..09da2abf48 100644
--- a/stdio/stdio.h
+++ b/stdio/stdio.h
@@ -426,7 +426,7 @@ extern int vsprintf __P ((char *__restrict __s,
 
 #ifdef	__OPTIMIZE__
 extern __inline int
-vprintf __P ((const char *__restrict __fmt, __gnuc_va_list __arg))
+vprintf (const char *__restrict __fmt, __gnuc_va_list __arg) __THROW
 {
   return vfprintf (stdout, __fmt, __arg);
 }
@@ -500,17 +500,17 @@ extern int vsscanf __P ((__const char *__s, __const char *__format,
 
 #ifdef	__OPTIMIZE__
 extern __inline int
-vfscanf __P ((FILE *__s, const char *__fmt, __gnuc_va_list __arg))
+vfscanf (FILE *__s, const char *__fmt, __gnuc_va_list __arg) __THROW
 {
   return __vfscanf (__s, __fmt, __arg);
 }
 extern __inline int
-vscanf __P ((const char *__fmt, __gnuc_va_list __arg))
+vscanf (const char *__fmt, __gnuc_va_list __arg) __THROW
 {
   return __vfscanf (stdin, __fmt, __arg);
 }
 extern __inline int
-vsscanf __P ((const char *__s, const char *__fmt, __gnuc_va_list __arg))
+vsscanf (const char *__s, const char *__fmt, __gnuc_va_list __arg) __THROW
 {
   return __vsscanf (__s, __fmt, __arg);
 }
@@ -542,7 +542,7 @@ extern int getchar __P ((void));
 
 #ifdef	__OPTIMIZE__
 extern __inline int
-getchar __P ((void))
+getchar (void) __THROW
 {
   return __getc (stdin);
 }
@@ -555,13 +555,13 @@ extern int getchar_unlocked __P ((void));
 
 # ifdef __OPTIMIZE__
 extern __inline int
-getc_unlocked __P ((FILE *__stream))
+getc_unlocked (FILE *__stream) __THROW
 {
   return __getc (__stream);
 }
 
 extern __inline int
-getchar_unlocked __P ((void))
+getchar_unlocked (void) __THROW
 {
   return __getc (stdin);
 }
@@ -590,7 +590,7 @@ extern int putchar __P ((int __c));
 
 #ifdef __OPTIMIZE__
 extern __inline int
-putchar __P ((int __c))
+putchar (int __c) __THROW
 {
   return __putc (__c, stdout);
 }
@@ -602,7 +602,7 @@ extern int fputc_unlocked __P ((int __c, FILE *__stream));
 
 # ifdef __OPTIMIZE__
 extern __inline int
-fputc_unlocked __P ((int __c, FILE *__stream))
+fputc_unlocked (int __c, FILE *__stream) __THROW
 {
   return __putc (__c, __stream);
 }
@@ -616,13 +616,13 @@ extern int putchar_unlocked __P ((int __c));
 
 # ifdef __OPTIMIZE__
 extern __inline int
-putc_unlocked __P ((int __c, FILE *__stream))
+putc_unlocked (int __c, FILE *__stream) __THROW
 {
   return __putc (__c, __stream);
 }
 
 extern __inline int
-putchar_unlocked __P ((int __c))
+putchar_unlocked (int __c) __THROW
 {
   return __putc (__c, stdout);
 }
@@ -673,7 +673,7 @@ ssize_t getline __P ((char **__lineptr, size_t *__n, FILE *__stream));
 
 #ifdef	__OPTIMIZE__
 extern __inline ssize_t
-getline __P ((char **__lineptr, size_t *__n, FILE *__stream))
+getline (char **__lineptr, size_t *__n, FILE *__stream) __THROW
 {
   return __getdelim (__lineptr, __n, '\n', __stream);
 }
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 7eb34fdf15..0b4120967e 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -236,31 +236,31 @@ extern unsigned long long int __strtoull_internal __P ((__const char *
 /* Define inline functions which call the internal entry points.  */
 
 extern __inline double
-strtod __P ((__const char *__restrict __nptr, char **__restrict __endptr))
+strtod (__const char *__restrict __nptr, char **__restrict __endptr) __THROW
 {
   return __strtod_internal (__nptr, __endptr, 0);
 }
 extern __inline long int
-strtol __P ((__const char *__restrict __nptr, char **__restrict __endptr,
-	     int __base))
+strtol (__const char *__restrict __nptr, char **__restrict __endptr,
+	int __base) __THROW
 {
   return __strtol_internal (__nptr, __endptr, __base, 0);
 }
 extern __inline unsigned long int
-strtoul __P ((__const char *__restrict __nptr, char **__restrict __endptr,
-	      int __base))
+strtoul (__const char *__restrict __nptr, char **__restrict __endptr,
+	 int __base) __THROW
 {
   return __strtoul_internal (__nptr, __endptr, __base, 0);
 }
 
 # ifdef __USE_ISOC9X
 extern __inline float
-strtof __P ((__const char *__restrict __nptr, char **__restrict __endptr))
+strtof (__const char *__restrict __nptr, char **__restrict __endptr) __THROW
 {
   return __strtof_internal (__nptr, __endptr, 0);
 }
 extern __inline __long_double_t
-strtold __P ((__const char *__restrict __nptr, char **__restrict __endptr))
+strtold (__const char *__restrict __nptr, char **__restrict __endptr) __THROW
 {
   return __strtold_internal (__nptr, __endptr, 0);
 }
@@ -268,14 +268,14 @@ strtold __P ((__const char *__restrict __nptr, char **__restrict __endptr))
 
 # ifdef __USE_BSD
 __extension__ extern __inline long long int
-strtoq __P ((__const char *__restrict __nptr, char **__restrict __endptr,
-	     int __base))
+strtoq (__const char *__restrict __nptr, char **__restrict __endptr,
+	int __base) __THROW
 {
   return __strtoll_internal (__nptr, __endptr, __base, 0);
 }
 __extension__ extern __inline unsigned long long int
-strtouq __P ((__const char *__restrict __nptr, char **__restrict __endptr,
-	      int __base))
+strtouq (__const char *__restrict __nptr, char **__restrict __endptr,
+	 int __base) __THROW
 {
   return __strtoull_internal (__nptr, __endptr, __base, 0);
 }
@@ -283,38 +283,38 @@ strtouq __P ((__const char *__restrict __nptr, char **__restrict __endptr,
 
 # if defined __USE_MISC || defined __USE_ISOC9X
 __extension__ extern __inline long long int
-strtoll __P ((__const char *__restrict __nptr, char **__restrict __endptr,
-	      int __base))
+strtoll (__const char *__restrict __nptr, char **__restrict __endptr,
+	 int __base) __THROW
 {
   return __strtoll_internal (__nptr, __endptr, __base, 0);
 }
 __extension__ extern __inline unsigned long long int
-strtoull __P ((__const char * __restrict __nptr, char **__restrict __endptr,
-	       int __base))
+strtoull (__const char * __restrict __nptr, char **__restrict __endptr,
+	  int __base) __THROW
 {
   return __strtoull_internal (__nptr, __endptr, __base, 0);
 }
 # endif
 
 extern __inline double
-atof __P ((__const char *__nptr))
+atof (__const char *__nptr) __THROW
 {
   return strtod (__nptr, (char **) NULL);
 }
 extern __inline int
-atoi __P ((__const char *__nptr))
+atoi (__const char *__nptr) __THROW
 {
   return (int) strtol (__nptr, (char **) NULL, 10);
 }
 extern __inline long int
-atol __P ((__const char *__nptr))
+atol (__const char *__nptr) __THROW
 {
   return strtol (__nptr, (char **) NULL, 10);
 }
 
 # if defined __USE_MISC || defined __USE_ISOC9X
 __extension__ extern __inline long long int
-atoll __P ((__const char *__nptr))
+atoll (__const char *__nptr) __THROW
 {
   return strtoll (__nptr, (char **) NULL, 10);
 }
diff --git a/string/argz.h b/string/argz.h
index 430726914d..437dba4cb6 100644
--- a/string/argz.h
+++ b/string/argz.h
@@ -137,7 +137,8 @@ extern char *argz_next __P ((__const char *argz, size_t __argz_len,
 
 #ifdef __USE_EXTERN_INLINES
 extern inline char *
-__argz_next __P ((__const char *__argz, size_t __argz_len, __const char *__entry))
+__argz_next (__const char *__argz, size_t __argz_len,
+	     __const char *__entry) __THROW
 {
   if (__entry)
     {
@@ -150,7 +151,8 @@ __argz_next __P ((__const char *__argz, size_t __argz_len, __const char *__entry
     return __argz_len > 0 ? (char *) __argz : 0;
 }
 extern inline char *
-argz_next __P ((__const char *__argz, size_t __argz_len, __const char *__entry))
+argz_next (__const char *__argz, size_t __argz_len,
+	   __const char *__entry) __THROW
 {
   return __argz_next (__argz, __argz_len, __entry);
 }
diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c
index ef7bc84866..4df06ed7b8 100644
--- a/sysdeps/unix/opendir.c
+++ b/sysdeps/unix/opendir.c
@@ -47,6 +47,17 @@ __opendir (const char *name)
       return NULL;
     }
 
+  /* We first have to check whether the name is for a directory.  We
+     cannot do this after the open() call since the open/close operation
+     performed on, say, a tape device might have undesirable effects.  */
+  if (stat (name, &statbuf) < 0)
+    return NULL;
+  if (! S_ISDIR (statbuf.st_mode))
+    {
+      __set_errno (ENOTDIR);
+      return NULL;
+    }
+
   fd = __open (name, O_RDONLY|O_NDELAY);
   if (fd < 0)
     return NULL;
@@ -54,14 +65,6 @@ __opendir (const char *name)
   if (__fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
     goto lose;
 
-  if (fstat (fd, &statbuf) < 0)
-    goto lose;
-  if (! S_ISDIR (statbuf.st_mode))
-    {
-      save_errno = ENOTDIR;
-      goto lose2;
-    }
-
 #ifdef _STATBUF_ST_BLKSIZE
   if (statbuf.st_blksize < sizeof (struct dirent))
     allocation = sizeof (struct dirent);
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 47d70611f1..30ba59fc57 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -200,7 +200,7 @@ struct cmsghdr
 extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr,
 					   struct cmsghdr *__cmsg));
 _EXTERN_INLINE struct cmsghdr *
-__cmsg_nxthdr __P ((struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
index ae44328fad..e18ffa818d 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
@@ -18,6 +18,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <string.h>
 #include <syscall.h>
 #include <sys/signal.h>
 #include <errno.h>
diff --git a/sysdeps/wordsize-32/inttypes.h b/sysdeps/wordsize-32/inttypes.h
index 48c97b3396..5897fdab19 100644
--- a/sysdeps/wordsize-32/inttypes.h
+++ b/sysdeps/wordsize-32/inttypes.h
@@ -278,8 +278,8 @@ extern long long int __strtoll_internal __P ((__const char *__restrict __nptr,
 #  define __strtoll_internal_defined	1
 # endif
 extern __inline intmax_t
-strtoimax __P ((__const char *__restrict nptr, char **__restrict endptr,
-		int base))
+strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+	   int base) __THROW
 {
   return __strtoll_internal (nptr, endptr, base, 0);
 }
@@ -296,8 +296,8 @@ extern unsigned long long int __strtoull_internal __P ((__const char *
 #  define __strtoull_internal_defined	1
 # endif
 extern __inline uintmax_t
-strtoumax __P ((__const char *__restrict nptr, char **__restrict endptr,
-		int base))
+strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+	   int base) __THROW
 {
   return __strtoull_internal (nptr, endptr, base, 0);
 }
@@ -312,8 +312,8 @@ extern long long int __wcstoll_internal __P ((__const wchar_t *
 #  define __wcstoll_internal_defined	1
 # endif
 extern __inline intmax_t
-wcstoimax __P ((__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
-		int base))
+wcstoimax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
+	   int base) __THROW
 {
   return __wcstoll_internal (nptr, endptr, base, 0);
 }
@@ -331,8 +331,8 @@ extern unsigned long long int __wcstoull_internal __P ((__const wchar_t *
 #  define __wcstoull_internal_defined	1
 # endif
 extern __inline uintmax_t
-wcstoumax __P ((__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
-		int base))
+wcstoumax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
+	   int base) __THROW
 {
   return __wcstoull_internal (nptr, endptr, base, 0);
 }
diff --git a/sysdeps/wordsize-64/inttypes.h b/sysdeps/wordsize-64/inttypes.h
index 48a7c8fd92..f37221b640 100644
--- a/sysdeps/wordsize-64/inttypes.h
+++ b/sysdeps/wordsize-64/inttypes.h
@@ -277,8 +277,8 @@ extern long int __strtol_internal __P ((__const char *__restrict __nptr,
 #  define __strtol_internal_defined	1
 # endif
 extern __inline intmax_t
-strtoimax __P ((__const char *__restrict nptr, char **__restrict endptr,
-		int base))
+strtoimax (__const char *__restrict nptr, char **__restrict endptr,
+	   int base) __THROW
 {
   return __strtol_internal (nptr, endptr, base, 0);
 }
@@ -292,8 +292,8 @@ extern unsigned long int __strtoul_internal __P ((__const char *
 #  define __strtoul_internal_defined	1
 # endif
 extern __inline uintmax_t
-strtoumax __P ((__const char *__restrict nptr, char **__restrict endptr,
-		int base))
+strtoumax (__const char *__restrict nptr, char **__restrict endptr,
+	   int base) __THROW
 {
   return __strtoul_internal (nptr, endptr, base, 0);
 }
@@ -306,8 +306,8 @@ extern long int __wcstol_internal __P ((__const wchar_t * __restrict __nptr,
 #  define __wcstol_internal_defined	1
 # endif
 extern __inline intmax_t
-wcstoimax __P ((__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
-		int base))
+wcstoimax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
+	   int base) __THROW
 {
   return __wcstol_internal (nptr, endptr, base, 0);
 }
@@ -323,8 +323,8 @@ extern unsigned long int __wcstoul_internal __P ((__const wchar_t *
 #  define __wcstoul_internal_defined	1
 # endif
 extern __inline uintmax_t
-wcstoumax __P ((__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
-		int base))
+wcstoumax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
+	   int base) __THROW
 {
   return __wcstoul_internal (nptr, endptr, base, 0);
 }
diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
index 570d4a6ce1..fddb3d626c 100644
--- a/wcsmbs/wchar.h
+++ b/wcsmbs/wchar.h
@@ -236,8 +236,8 @@ extern size_t mbrlen __P ((__const char *__restrict __s, size_t __n,
 #if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \
     && defined __USE_EXTERN_INLINES
 /* Define inline function as optimization.  */
-extern __inline size_t mbrlen __P ((__const char *__restrict __s, size_t __n,
-				    mbstate_t *__restrict __ps))
+extern __inline size_t mbrlen (__const char *__restrict __s, size_t __n,
+			       mbstate_t *__restrict __ps) __THROW
 { return (__ps != NULL
 	  ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); }
 #endif
@@ -440,40 +440,37 @@ extern unsigned long long int __wcstoull_internal __P ((__const wchar_t *
 #if defined __OPTIMIZE__ && __GNUC__ >= 2
 /* Define inline functions which call the internal entry points.  */
 
-extern __inline double wcstod __P ((__const wchar_t *__restrict __nptr,
-				    wchar_t **__restrict __endptr))
+extern __inline double wcstod (__const wchar_t *__restrict __nptr,
+			       wchar_t **__restrict __endptr) __THROW
 { return __wcstod_internal (__nptr, __endptr, 0); }
-extern __inline long int wcstol __P ((__const wchar_t *__restrict __nptr,
-				      wchar_t **__restrict __endptr,
-				      int __base))
+extern __inline long int wcstol (__const wchar_t *__restrict __nptr,
+                                 wchar_t **__restrict __endptr,
+				 int __base) __THROW
 { return __wcstol_internal (__nptr, __endptr, __base, 0); }
-extern __inline unsigned long int wcstoul __P ((__const wchar_t *
-						__restrict __nptr,
-						wchar_t **__restrict __endptr,
-						int __base))
+extern __inline unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
+                                           wchar_t **__restrict __endptr,
+					   int __base) __THROW
 { return __wcstoul_internal (__nptr, __endptr, __base, 0); }
 
 # ifdef __USE_GNU
-extern __inline float wcstof __P ((__const wchar_t *__restrict __nptr,
-				   wchar_t **__restrict __endptr))
+extern __inline float wcstof (__const wchar_t *__restrict __nptr,
+			      wchar_t **__restrict __endptr) __THROW
 { return __wcstof_internal (__nptr, __endptr, 0); }
-extern __inline __long_double_t wcstold __P ((__const wchar_t *
-					      __restrict __nptr,
-					      wchar_t **__restrict __endptr))
+extern __inline __long_double_t wcstold (__const wchar_t *__restrict __nptr,
+					 wchar_t **__restrict __endptr) __THROW
 { return __wcstold_internal (__nptr, __endptr, 0); }
 
 
 __extension__
-extern __inline long long int wcstoq __P ((__const wchar_t *__restrict __nptr,
-					   wchar_t **__restrict __endptr,
-					   int __base))
+extern __inline long long int wcstoq (__const wchar_t *__restrict __nptr,
+				      wchar_t **__restrict __endptr,
+				      int __base) __THROW
 { return __wcstoll_internal (__nptr, __endptr, __base, 0); }
 __extension__
-extern __inline unsigned long long int wcstouq __P ((__const wchar_t *
-						     __restrict __nptr,
-						     wchar_t **
-						     __restrict __endptr,
-						     int __base))
+extern __inline unsigned long long int wcstouq (__const wchar_t *
+						__restrict __nptr,
+						wchar_t **__restrict __endptr,
+						int __base) __THROW
 { return __wcstoull_internal (__nptr, __endptr, __base, 0); }
 # endif /* Use GNU.  */
 #endif /* Optimizing GCC >=2.  */