about summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
Diffstat (limited to 'string')
-rw-r--r--string/argz.h62
-rw-r--r--string/bits/string2.h321
-rw-r--r--string/bits/string3.h27
-rw-r--r--string/envz.h18
-rw-r--r--string/string.h176
-rw-r--r--string/strings.h31
6 files changed, 313 insertions, 322 deletions
diff --git a/string/argz.h b/string/argz.h
index 4141d998f9..96bf85b913 100644
--- a/string/argz.h
+++ b/string/argz.h
@@ -1,5 +1,5 @@
 /* Routines for dealing with '\0' separated arg vectors.
-   Copyright (C) 1995,96,97,98,99,2000,2004,2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000,2004,2007,2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -26,10 +26,6 @@
 #include <errno.h>
 #include <string.h>		/* Need size_t, and strchr is called below.  */
 
-#ifndef __const
-# define __const const
-#endif
-
 #ifndef __error_t_defined
 typedef int error_t;
 #endif
@@ -40,33 +36,33 @@ __BEGIN_DECLS
 /* Make a '\0' separated arg vector from a unix argv vector, returning it in
    ARGZ, and the total length in LEN.  If a memory allocation error occurs,
    ENOMEM is returned, otherwise 0.  The result can be destroyed using free. */
-extern error_t __argz_create (char *__const __argv[], char **__restrict __argz,
+extern error_t __argz_create (char *const __argv[], char **__restrict __argz,
 			      size_t *__restrict __len) __THROW;
-extern error_t argz_create (char *__const __argv[], char **__restrict __argz,
+extern error_t argz_create (char *const __argv[], char **__restrict __argz,
 			    size_t *__restrict __len) __THROW;
 
 /* Make a '\0' separated arg vector from a SEP separated list in
    STRING, returning it in ARGZ, and the total length in LEN.  If a
    memory allocation error occurs, ENOMEM is returned, otherwise 0.
    The result can be destroyed using free.  */
-extern error_t __argz_create_sep (__const char *__restrict __string,
+extern error_t __argz_create_sep (const char *__restrict __string,
 				  int __sep, char **__restrict __argz,
 				  size_t *__restrict __len) __THROW;
-extern error_t argz_create_sep (__const char *__restrict __string,
+extern error_t argz_create_sep (const char *__restrict __string,
 				int __sep, char **__restrict __argz,
 				size_t *__restrict __len) __THROW;
 
 /* Returns the number of strings in ARGZ.  */
-extern size_t __argz_count (__const char *__argz, size_t __len)
+extern size_t __argz_count (const char *__argz, size_t __len)
      __THROW __attribute_pure__;
-extern size_t argz_count (__const char *__argz, size_t __len)
+extern size_t argz_count (const char *__argz, size_t __len)
      __THROW __attribute_pure__;
 
 /* Puts pointers to each string in ARGZ into ARGV, which must be large enough
    to hold them all.  */
-extern void __argz_extract (__const char *__restrict __argz, size_t __len,
+extern void __argz_extract (const char *__restrict __argz, size_t __len,
 			    char **__restrict __argv) __THROW;
-extern void argz_extract (__const char *__restrict __argz, size_t __len,
+extern void argz_extract (const char *__restrict __argz, size_t __len,
 			  char **__restrict __argv) __THROW;
 
 /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
@@ -77,30 +73,30 @@ extern void argz_stringify (char *__argz, size_t __len, int __sep) __THROW;
 /* Append BUF, of length BUF_LEN to the argz vector in ARGZ & ARGZ_LEN.  */
 extern error_t __argz_append (char **__restrict __argz,
 			      size_t *__restrict __argz_len,
-			      __const char *__restrict __buf, size_t _buf_len)
+			      const char *__restrict __buf, size_t __buf_len)
      __THROW;
 extern error_t argz_append (char **__restrict __argz,
 			    size_t *__restrict __argz_len,
-			    __const char *__restrict __buf, size_t __buf_len)
+			    const char *__restrict __buf, size_t __buf_len)
      __THROW;
 
 /* Append STR to the argz vector in ARGZ & ARGZ_LEN.  */
 extern error_t __argz_add (char **__restrict __argz,
 			   size_t *__restrict __argz_len,
-			   __const char *__restrict __str) __THROW;
+			   const char *__restrict __str) __THROW;
 extern error_t argz_add (char **__restrict __argz,
 			 size_t *__restrict __argz_len,
-			 __const char *__restrict __str) __THROW;
+			 const char *__restrict __str) __THROW;
 
 /* Append SEP separated list in STRING to the argz vector in ARGZ &
    ARGZ_LEN.  */
 extern error_t __argz_add_sep (char **__restrict __argz,
 			       size_t *__restrict __argz_len,
-			       __const char *__restrict __string, int __delim)
+			       const char *__restrict __string, int __delim)
      __THROW;
 extern error_t argz_add_sep (char **__restrict __argz,
 			     size_t *__restrict __argz_len,
-			     __const char *__restrict __string, int __delim)
+			     const char *__restrict __string, int __delim)
      __THROW;
 
 /* Delete ENTRY from ARGZ & ARGZ_LEN, if it appears there.  */
@@ -120,24 +116,24 @@ extern void argz_delete (char **__restrict __argz,
 extern error_t __argz_insert (char **__restrict __argz,
 			      size_t *__restrict __argz_len,
 			      char *__restrict __before,
-			      __const char *__restrict __entry) __THROW;
+			      const char *__restrict __entry) __THROW;
 extern error_t argz_insert (char **__restrict __argz,
 			    size_t *__restrict __argz_len,
 			    char *__restrict __before,
-			    __const char *__restrict __entry) __THROW;
+			    const char *__restrict __entry) __THROW;
 
 /* Replace any occurrences of the string STR in ARGZ with WITH, reallocating
    ARGZ as necessary.  If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be
    incremented by number of replacements performed.  */
 extern error_t __argz_replace (char **__restrict __argz,
 			       size_t *__restrict __argz_len,
-			       __const char *__restrict __str,
-			       __const char *__restrict __with,
+			       const char *__restrict __str,
+			       const char *__restrict __with,
 			       unsigned int *__restrict __replace_count);
 extern error_t argz_replace (char **__restrict __argz,
 			     size_t *__restrict __argz_len,
-			     __const char *__restrict __str,
-			     __const char *__restrict __with,
+			     const char *__restrict __str,
+			     const char *__restrict __with,
 			     unsigned int *__restrict __replace_count);
 
 /* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
@@ -154,15 +150,15 @@ extern error_t argz_replace (char **__restrict __argz,
     for (entry = argz; entry; entry = argz_next (argz, argz_len, entry))
       ...;
 */
-extern char *__argz_next (__const char *__restrict __argz, size_t __argz_len,
-			  __const char *__restrict __entry) __THROW;
-extern char *argz_next (__const char *__restrict __argz, size_t __argz_len,
-			__const char *__restrict __entry) __THROW;
+extern char *__argz_next (const char *__restrict __argz, size_t __argz_len,
+			  const char *__restrict __entry) __THROW;
+extern char *argz_next (const char *__restrict __argz, size_t __argz_len,
+			const char *__restrict __entry) __THROW;
 
 #ifdef __USE_EXTERN_INLINES
 __extern_inline char *
-__NTH (__argz_next (__const char *__argz, size_t __argz_len,
-		    __const char *__entry))
+__NTH (__argz_next (const char *__argz, size_t __argz_len,
+		    const char *__entry))
 {
   if (__entry)
     {
@@ -175,8 +171,8 @@ __NTH (__argz_next (__const char *__argz, size_t __argz_len,
     return __argz_len > 0 ? (char *) __argz : 0;
 }
 __extern_inline char *
-__NTH (argz_next (__const char *__argz, size_t __argz_len,
-		  __const char *__entry))
+__NTH (argz_next (const char *__argz, size_t __argz_len,
+		  const char *__entry))
 {
   return __argz_next (__argz, __argz_len, __entry);
 }
diff --git a/string/bits/string2.h b/string/bits/string2.h
index d298bed9f8..f2945b3a1c 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -1,5 +1,5 @@
 /* Machine-independant string function optimizations.
-   Copyright (C) 1997-2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997-2004, 2007, 2008, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -54,22 +54,22 @@
 
 # if __BYTE_ORDER == __LITTLE_ENDIAN
 #  define __STRING2_SMALL_GET16(src, idx) \
-     (((__const unsigned char *) (__const char *) (src))[idx + 1] << 8	      \
-      | ((__const unsigned char *) (__const char *) (src))[idx])
+     (((const unsigned char *) (const char *) (src))[idx + 1] << 8	      \
+      | ((const unsigned char *) (const char *) (src))[idx])
 #  define __STRING2_SMALL_GET32(src, idx) \
-     (((((__const unsigned char *) (__const char *) (src))[idx + 3] << 8      \
-	| ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8   \
-       | ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8    \
-      | ((__const unsigned char *) (__const char *) (src))[idx])
+     (((((const unsigned char *) (const char *) (src))[idx + 3] << 8	      \
+	| ((const unsigned char *) (const char *) (src))[idx + 2]) << 8	      \
+       | ((const unsigned char *) (const char *) (src))[idx + 1]) << 8	      \
+      | ((const unsigned char *) (const char *) (src))[idx])
 # else
 #  define __STRING2_SMALL_GET16(src, idx) \
-     (((__const unsigned char *) (__const char *) (src))[idx] << 8	      \
-      | ((__const unsigned char *) (__const char *) (src))[idx + 1])
+     (((const unsigned char *) (const char *) (src))[idx] << 8		      \
+      | ((const unsigned char *) (const char *) (src))[idx + 1])
 #  define __STRING2_SMALL_GET32(src, idx) \
-     (((((__const unsigned char *) (__const char *) (src))[idx] << 8	      \
-	| ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8   \
-       | ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8    \
-      | ((__const unsigned char *) (__const char *) (src))[idx + 3])
+     (((((const unsigned char *) (const char *) (src))[idx] << 8	      \
+	| ((const unsigned char *) (const char *) (src))[idx + 1]) << 8	      \
+       | ((const unsigned char *) (const char *) (src))[idx + 2]) << 8	      \
+      | ((const unsigned char *) (const char *) (src))[idx + 3])
 # endif
 #else
 /* These are a few types we need for the optimizations if we cannot
@@ -227,8 +227,8 @@ __STRING2_COPY_TYPE (8);
 #   if _STRING_ARCH_unaligned
 #    ifndef _FORCE_INLINES
 #     define __mempcpy_args(src) \
-     ((__const char *) (src))[0], ((__const char *) (src))[2],		      \
-     ((__const char *) (src))[4], ((__const char *) (src))[6],		      \
+     ((const char *) (src))[0], ((const char *) (src))[2],		      \
+     ((const char *) (src))[4], ((const char *) (src))[6],		      \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 4),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 0),			      \
@@ -302,33 +302,33 @@ __mempcpy_small (void *__dest1,
 #   else
 #    ifndef _FORCE_INLINES
 #     define __mempcpy_args(src) \
-     ((__const char *) (src))[0],					      \
+     ((const char *) (src))[0],						      \
      __extension__ ((__STRING2_COPY_ARR2)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1] } }),      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1] } }),	      \
      __extension__ ((__STRING2_COPY_ARR3)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2] } }),				      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2] } }),				      \
      __extension__ ((__STRING2_COPY_ARR4)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3] } }),      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3] } }),	      \
      __extension__ ((__STRING2_COPY_ARR5)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4] } }),				      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4] } }),				      \
      __extension__ ((__STRING2_COPY_ARR6)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], ((__const char *) (src))[5] } }),      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], ((const char *) (src))[5] } }),	      \
      __extension__ ((__STRING2_COPY_ARR7)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
-	  ((__const char *) (src))[6] } }),				      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], ((const char *) (src))[5],		      \
+	  ((const char *) (src))[6] } }),				      \
      __extension__ ((__STRING2_COPY_ARR8)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
-	  ((__const char *) (src))[6], ((__const char *) (src))[7] } })
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], ((const char *) (src))[5],		      \
+	  ((const char *) (src))[6], ((const char *) (src))[7] } })
 #    endif
 __STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2,
 				       __STRING2_COPY_ARR3,
@@ -486,31 +486,31 @@ __strcpy_small (char *__dest,
 #  ifndef _FORCE_INLINES
 #   define __strcpy_args(src) \
      __extension__ ((__STRING2_COPY_ARR2)				      \
-      { { ((__const char *) (src))[0], '\0' } }),			      \
+      { { ((const char *) (src))[0], '\0' } }),				      \
      __extension__ ((__STRING2_COPY_ARR3)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
 	  '\0' } }),							      \
      __extension__ ((__STRING2_COPY_ARR4)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], '\0' } }),			      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], '\0' } }),				      \
      __extension__ ((__STRING2_COPY_ARR5)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
 	  '\0' } }),							      \
      __extension__ ((__STRING2_COPY_ARR6)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], '\0' } }),			      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], '\0' } }),				      \
      __extension__ ((__STRING2_COPY_ARR7)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], ((const char *) (src))[5],		      \
 	  '\0' } }),							      \
      __extension__ ((__STRING2_COPY_ARR8)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
-	  ((__const char *) (src))[6], '\0' } })
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], ((const char *) (src))[5],		      \
+	  ((const char *) (src))[6], '\0' } })
 #  endif
 __STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2,
 				      __STRING2_COPY_ARR3,
@@ -670,31 +670,31 @@ __stpcpy_small (char *__dest,
 #    ifndef _FORCE_INLINES
 #     define __stpcpy_args(src) \
      __extension__ ((__STRING2_COPY_ARR2)				      \
-      { { ((__const char *) (src))[0], '\0' } }),			      \
+      { { ((const char *) (src))[0], '\0' } }),				      \
      __extension__ ((__STRING2_COPY_ARR3)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
 	  '\0' } }),							      \
      __extension__ ((__STRING2_COPY_ARR4)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], '\0' } }),			      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], '\0' } }),				      \
      __extension__ ((__STRING2_COPY_ARR5)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
 	  '\0' } }),							      \
      __extension__ ((__STRING2_COPY_ARR6)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], '\0' } }),			      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], '\0' } }),				      \
      __extension__ ((__STRING2_COPY_ARR7)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], ((const char *) (src))[5],		      \
 	  '\0' } }),							      \
      __extension__ ((__STRING2_COPY_ARR8)				      \
-      { { ((__const char *) (src))[0], ((__const char *) (src))[1],	      \
-	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
-	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
-	  ((__const char *) (src))[6], '\0' } })
+      { { ((const char *) (src))[0], ((const char *) (src))[1],		      \
+	  ((const char *) (src))[2], ((const char *) (src))[3],		      \
+	  ((const char *) (src))[4], ((const char *) (src))[5],		      \
+	  ((const char *) (src))[6], '\0' } })
 #    endif
 __STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2,
 				      __STRING2_COPY_ARR3,
@@ -824,7 +824,7 @@ __stpcpy_small (char *__dest,
       && (__s1_len = strlen (s1), __s2_len = strlen (s2),		      \
 	  (!__string2_1bptr_p (s1) || __s1_len >= 4)			      \
 	  && (!__string2_1bptr_p (s2) || __s2_len >= 4))		      \
-      ? memcmp ((__const char *) (s1), (__const char *) (s2),		      \
+      ? memcmp ((const char *) (s1), (const char *) (s2),		      \
 		(__s1_len < __s2_len ? __s1_len : __s2_len) + 1)	      \
       : (__builtin_constant_p (s1) && __string2_1bptr_p (s1)		      \
 	 && (__s1_len = strlen (s1), __s1_len < 4)			      \
@@ -841,74 +841,74 @@ __stpcpy_small (char *__dest,
 
 # define __strcmp_cc(s1, s2, l) \
   (__extension__ ({ register int __result =				      \
-		      (((__const unsigned char *) (__const char *) (s1))[0]   \
-		       - ((__const unsigned char *) (__const char *)(s2))[0]);\
+		      (((const unsigned char *) (const char *) (s1))[0]	      \
+		       - ((const unsigned char *) (const char *)(s2))[0]);    \
 		    if (l > 0 && __result == 0)				      \
 		      {							      \
-			__result = (((__const unsigned char *)		      \
-				     (__const char *) (s1))[1]		      \
-				    - ((__const unsigned char *)	      \
-				       (__const char *) (s2))[1]);	      \
+			__result = (((const unsigned char *)		      \
+				     (const char *) (s1))[1]		      \
+				    - ((const unsigned char *)		      \
+				       (const char *) (s2))[1]);	      \
 			if (l > 1 && __result == 0)			      \
 			  {						      \
 			    __result =					      \
-			      (((__const unsigned char *)		      \
-				(__const char *) (s1))[2]		      \
-			       - ((__const unsigned char *)		      \
-				  (__const char *) (s2))[2]);		      \
+			      (((const unsigned char *)			      \
+				(const char *) (s1))[2]			      \
+			       - ((const unsigned char *)		      \
+				  (const char *) (s2))[2]);		      \
 			    if (l > 2 && __result == 0)			      \
 			      __result =				      \
-				(((__const unsigned char *)		      \
-				  (__const char *) (s1))[3]		      \
-				 - ((__const unsigned char *)		      \
-				    (__const char *) (s2))[3]);		      \
+				(((const unsigned char *)		      \
+				  (const char *) (s1))[3]		      \
+				 - ((const unsigned char *)		      \
+				    (const char *) (s2))[3]);		      \
 			  }						      \
 		      }							      \
 		    __result; }))
 
 # define __strcmp_cg(s1, s2, l1) \
-  (__extension__ ({ __const unsigned char *__s2 =			      \
-		      (__const unsigned char *) (__const char *) (s2);	      \
+  (__extension__ ({ const unsigned char *__s2 =				      \
+		      (const unsigned char *) (const char *) (s2);	      \
 		    register int __result =				      \
-		      (((__const unsigned char *) (__const char *) (s1))[0]   \
+		      (((const unsigned char *) (const char *) (s1))[0]	      \
 		       - __s2[0]);					      \
 		    if (l1 > 0 && __result == 0)			      \
 		      {							      \
-			__result = (((__const unsigned char *)		      \
-				     (__const char *) (s1))[1] - __s2[1]);    \
+			__result = (((const unsigned char *)		      \
+				     (const char *) (s1))[1] - __s2[1]);      \
 			if (l1 > 1 && __result == 0)			      \
 			  {						      \
-			    __result = (((__const unsigned char *)	      \
-					 (__const char *) (s1))[2] - __s2[2]);\
+			    __result = (((const unsigned char *)	      \
+					 (const char *) (s1))[2] - __s2[2]);  \
 			    if (l1 > 2 && __result == 0)		      \
-			      __result = (((__const unsigned char *)	      \
-					  (__const char *)  (s1))[3]	      \
+			      __result = (((const unsigned char *)	      \
+					  (const char *)  (s1))[3]	      \
 					  - __s2[3]);			      \
 			  }						      \
 		      }							      \
 		    __result; }))
 
 # define __strcmp_gc(s1, s2, l2) \
-  (__extension__ ({ __const unsigned char *__s1 =			      \
-		      (__const unsigned char *) (__const char *) (s1);	      \
+  (__extension__ ({ const unsigned char *__s1 =				      \
+		      (const unsigned char *) (const char *) (s1);	      \
 		    register int __result =				      \
-		      __s1[0] - ((__const unsigned char *)		      \
-				 (__const char *) (s2))[0];		      \
+		      __s1[0] - ((const unsigned char *)		      \
+				 (const char *) (s2))[0];		      \
 		    if (l2 > 0 && __result == 0)			      \
 		      {							      \
 			__result = (__s1[1]				      \
-				    - ((__const unsigned char *)	      \
-				       (__const char *) (s2))[1]);	      \
+				    - ((const unsigned char *)		      \
+				       (const char *) (s2))[1]);	      \
 			if (l2 > 1 && __result == 0)			      \
 			  {						      \
 			    __result =					      \
-			      (__s1[2] - ((__const unsigned char *)	      \
-					  (__const char *) (s2))[2]);	      \
+			      (__s1[2] - ((const unsigned char *)	      \
+					  (const char *) (s2))[2]);	      \
 			    if (l2 > 2 && __result == 0)		      \
 			      __result =				      \
 				(__s1[3]				      \
-				 - ((__const unsigned char *)		      \
-				    (__const char *) (s2))[3]);		      \
+				 - ((const unsigned char *)		      \
+				    (const char *) (s2))[3]);		      \
 			  }						      \
 		      }							      \
 		    __result; }))
@@ -938,13 +938,13 @@ __stpcpy_small (char *__dest,
      (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
       ? ((__builtin_constant_p (s) && __string2_1bptr_p (s))		      \
 	 ? __builtin_strcspn (s, reject)				      \
-	 : ((__r0 = ((__const char *) (reject))[0], __r0 == '\0')	      \
+	 : ((__r0 = ((const char *) (reject))[0], __r0 == '\0')		      \
 	    ? strlen (s)						      \
-	    : ((__r1 = ((__const char *) (reject))[1], __r1 == '\0')	      \
+	    : ((__r1 = ((const char *) (reject))[1], __r1 == '\0')	      \
 	       ? __strcspn_c1 (s, __r0)					      \
-	       : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0')	      \
+	       : ((__r2 = ((const char *) (reject))[2], __r2 == '\0')	      \
 		  ? __strcspn_c2 (s, __r0, __r1)			      \
-		  : (((__const char *) (reject))[3] == '\0'		      \
+		  : (((const char *) (reject))[3] == '\0'		      \
 		     ? __strcspn_c3 (s, __r0, __r1, __r2)		      \
 		     : __builtin_strcspn (s, reject))))))		      \
       : __builtin_strcspn (s, reject)); })
@@ -953,22 +953,22 @@ __stpcpy_small (char *__dest,
   __extension__								      \
   ({ char __r0, __r1, __r2;						      \
      (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
-      ? ((__r0 = ((__const char *) (reject))[0], __r0 == '\0')		      \
+      ? ((__r0 = ((const char *) (reject))[0], __r0 == '\0')		      \
 	 ? strlen (s)							      \
-	 : ((__r1 = ((__const char *) (reject))[1], __r1 == '\0')	      \
+	 : ((__r1 = ((const char *) (reject))[1], __r1 == '\0')		      \
 	    ? __strcspn_c1 (s, __r0)					      \
-	    : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0')	      \
+	    : ((__r2 = ((const char *) (reject))[2], __r2 == '\0')	      \
 	       ? __strcspn_c2 (s, __r0, __r1)				      \
-	       : (((__const char *) (reject))[3] == '\0'		      \
+	       : (((const char *) (reject))[3] == '\0'			      \
 		  ? __strcspn_c3 (s, __r0, __r1, __r2)			      \
 		  : strcspn (s, reject)))))				      \
       : strcspn (s, reject)); })
 #  endif
 # endif
 
-__STRING_INLINE size_t __strcspn_c1 (__const char *__s, int __reject);
+__STRING_INLINE size_t __strcspn_c1 (const char *__s, int __reject);
 __STRING_INLINE size_t
-__strcspn_c1 (__const char *__s, int __reject)
+__strcspn_c1 (const char *__s, int __reject)
 {
   register size_t __result = 0;
   while (__s[__result] != '\0' && __s[__result] != __reject)
@@ -976,10 +976,10 @@ __strcspn_c1 (__const char *__s, int __reject)
   return __result;
 }
 
-__STRING_INLINE size_t __strcspn_c2 (__const char *__s, int __reject1,
+__STRING_INLINE size_t __strcspn_c2 (const char *__s, int __reject1,
 				     int __reject2);
 __STRING_INLINE size_t
-__strcspn_c2 (__const char *__s, int __reject1, int __reject2)
+__strcspn_c2 (const char *__s, int __reject1, int __reject2)
 {
   register size_t __result = 0;
   while (__s[__result] != '\0' && __s[__result] != __reject1
@@ -988,10 +988,10 @@ __strcspn_c2 (__const char *__s, int __reject1, int __reject2)
   return __result;
 }
 
-__STRING_INLINE size_t __strcspn_c3 (__const char *__s, int __reject1,
+__STRING_INLINE size_t __strcspn_c3 (const char *__s, int __reject1,
 				     int __reject2, int __reject3);
 __STRING_INLINE size_t
-__strcspn_c3 (__const char *__s, int __reject1, int __reject2,
+__strcspn_c3 (const char *__s, int __reject1, int __reject2,
 	      int __reject3)
 {
   register size_t __result = 0;
@@ -1014,13 +1014,13 @@ __strcspn_c3 (__const char *__s, int __reject1, int __reject2,
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
       ? ((__builtin_constant_p (s) && __string2_1bptr_p (s))		      \
 	 ? __builtin_strspn (s, accept)					      \
-	 : ((__a0 = ((__const char *) (accept))[0], __a0 == '\0')	      \
+	 : ((__a0 = ((const char *) (accept))[0], __a0 == '\0')		      \
 	    ? ((void) (s), 0)						      \
-	    : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
+	    : ((__a1 = ((const char *) (accept))[1], __a1 == '\0')	      \
 	       ? __strspn_c1 (s, __a0)					      \
-	       : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
+	       : ((__a2 = ((const char *) (accept))[2], __a2 == '\0')	      \
 		  ? __strspn_c2 (s, __a0, __a1)				      \
-		  : (((__const char *) (accept))[3] == '\0'		      \
+		  : (((const char *) (accept))[3] == '\0'		      \
 		     ? __strspn_c3 (s, __a0, __a1, __a2)		      \
 		     : __builtin_strspn (s, accept))))))		      \
       : __builtin_strspn (s, accept)); })
@@ -1029,22 +1029,22 @@ __strcspn_c3 (__const char *__s, int __reject1, int __reject2,
   __extension__								      \
   ({ char __a0, __a1, __a2;						      \
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
-      ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0')		      \
+      ? ((__a0 = ((const char *) (accept))[0], __a0 == '\0')		      \
 	 ? ((void) (s), 0)						      \
-	 : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
+	 : ((__a1 = ((const char *) (accept))[1], __a1 == '\0')		      \
 	    ? __strspn_c1 (s, __a0)					      \
-	    : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
+	    : ((__a2 = ((const char *) (accept))[2], __a2 == '\0')	      \
 	       ? __strspn_c2 (s, __a0, __a1)				      \
-	       : (((__const char *) (accept))[3] == '\0'		      \
+	       : (((const char *) (accept))[3] == '\0'			      \
 		  ? __strspn_c3 (s, __a0, __a1, __a2)			      \
 		  : strspn (s, accept)))))				      \
       : strspn (s, accept)); })
 #  endif
 # endif
 
-__STRING_INLINE size_t __strspn_c1 (__const char *__s, int __accept);
+__STRING_INLINE size_t __strspn_c1 (const char *__s, int __accept);
 __STRING_INLINE size_t
-__strspn_c1 (__const char *__s, int __accept)
+__strspn_c1 (const char *__s, int __accept)
 {
   register size_t __result = 0;
   /* Please note that __accept never can be '\0'.  */
@@ -1053,10 +1053,10 @@ __strspn_c1 (__const char *__s, int __accept)
   return __result;
 }
 
-__STRING_INLINE size_t __strspn_c2 (__const char *__s, int __accept1,
+__STRING_INLINE size_t __strspn_c2 (const char *__s, int __accept1,
 				    int __accept2);
 __STRING_INLINE size_t
-__strspn_c2 (__const char *__s, int __accept1, int __accept2)
+__strspn_c2 (const char *__s, int __accept1, int __accept2)
 {
   register size_t __result = 0;
   /* Please note that __accept1 and __accept2 never can be '\0'.  */
@@ -1065,10 +1065,10 @@ __strspn_c2 (__const char *__s, int __accept1, int __accept2)
   return __result;
 }
 
-__STRING_INLINE size_t __strspn_c3 (__const char *__s, int __accept1,
+__STRING_INLINE size_t __strspn_c3 (const char *__s, int __accept1,
 				    int __accept2, int __accept3);
 __STRING_INLINE size_t
-__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
+__strspn_c3 (const char *__s, int __accept1, int __accept2, int __accept3)
 {
   register size_t __result = 0;
   /* Please note that __accept1 to __accept3 never can be '\0'.  */
@@ -1090,13 +1090,13 @@ __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
       ? ((__builtin_constant_p (s) && __string2_1bptr_p (s))		      \
 	 ? __builtin_strpbrk (s, accept)				      \
-	 : ((__a0 = ((__const char  *) (accept))[0], __a0 == '\0')	      \
+	 : ((__a0 = ((const char  *) (accept))[0], __a0 == '\0')	      \
 	    ? ((void) (s), (char *) NULL)				      \
-	    : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
+	    : ((__a1 = ((const char *) (accept))[1], __a1 == '\0')	      \
 	       ? __builtin_strchr (s, __a0)				      \
-	       : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
+	       : ((__a2 = ((const char *) (accept))[2], __a2 == '\0')	      \
 		  ? __strpbrk_c2 (s, __a0, __a1)			      \
-		  : (((__const char *) (accept))[3] == '\0'		      \
+		  : (((const char *) (accept))[3] == '\0'		      \
 		     ? __strpbrk_c3 (s, __a0, __a1, __a2)		      \
 		     : __builtin_strpbrk (s, accept))))))		      \
       : __builtin_strpbrk (s, accept)); })
@@ -1105,23 +1105,23 @@ __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
   __extension__								      \
   ({ char __a0, __a1, __a2;						      \
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
-      ? ((__a0 = ((__const char  *) (accept))[0], __a0 == '\0')		      \
+      ? ((__a0 = ((const char  *) (accept))[0], __a0 == '\0')		      \
 	 ? ((void) (s), (char *) NULL)					      \
-	 : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
+	 : ((__a1 = ((const char *) (accept))[1], __a1 == '\0')		      \
 	    ? strchr (s, __a0)						      \
-	    : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
+	    : ((__a2 = ((const char *) (accept))[2], __a2 == '\0')	      \
 	       ? __strpbrk_c2 (s, __a0, __a1)				      \
-	       : (((__const char *) (accept))[3] == '\0'		      \
+	       : (((const char *) (accept))[3] == '\0'			      \
 		  ? __strpbrk_c3 (s, __a0, __a1, __a2)			      \
 		  : strpbrk (s, accept)))))				      \
       : strpbrk (s, accept)); })
 #  endif
 # endif
 
-__STRING_INLINE char *__strpbrk_c2 (__const char *__s, int __accept1,
-				     int __accept2);
+__STRING_INLINE char *__strpbrk_c2 (const char *__s, int __accept1,
+				    int __accept2);
 __STRING_INLINE char *
-__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
+__strpbrk_c2 (const char *__s, int __accept1, int __accept2)
 {
   /* Please note that __accept1 and __accept2 never can be '\0'.  */
   while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
@@ -1129,11 +1129,10 @@ __strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
   return *__s == '\0' ? NULL : (char *) (size_t) __s;
 }
 
-__STRING_INLINE char *__strpbrk_c3 (__const char *__s, int __accept1,
-				     int __accept2, int __accept3);
+__STRING_INLINE char *__strpbrk_c3 (const char *__s, int __accept1,
+				    int __accept2, int __accept3);
 __STRING_INLINE char *
-__strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
-	      int __accept3)
+__strpbrk_c3 (const char *__s, int __accept1, int __accept2, int __accept3)
 {
   /* Please note that __accept1 to __accept3 never can be '\0'.  */
   while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
@@ -1149,11 +1148,11 @@ __strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
 #if !defined _HAVE_STRING_ARCH_strstr && !__GNUC_PREREQ (2, 97)
 # define strstr(haystack, needle) \
   (__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p (needle) \
-		  ? (((__const char *) (needle))[0] == '\0'		      \
+		  ? (((const char *) (needle))[0] == '\0'		      \
 		     ? (char *) (size_t) (haystack)			      \
-		     : (((__const char *) (needle))[1] == '\0'		      \
+		     : (((const char *) (needle))[1] == '\0'		      \
 			? strchr (haystack,				      \
-				  ((__const char *) (needle))[0]) 	      \
+				  ((const char *) (needle))[0]) 	      \
 			: strstr (haystack, needle)))			      \
 		  : strstr (haystack, needle)))
 #endif
@@ -1163,9 +1162,9 @@ __strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
 # ifndef _HAVE_STRING_ARCH_strtok_r
 #  define __strtok_r(s, sep, nextp) \
   (__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep)	      \
-		  && ((__const char *) (sep))[0] != '\0'		      \
-		  && ((__const char *) (sep))[1] == '\0'		      \
-		  ? __strtok_r_1c (s, ((__const char *) (sep))[0], nextp)     \
+		  && ((const char *) (sep))[0] != '\0'			      \
+		  && ((const char *) (sep))[1] == '\0'			      \
+		  ? __strtok_r_1c (s, ((const char *) (sep))[0], nextp)       \
 		  : __strtok_r (s, sep, nextp)))
 # endif
 
@@ -1201,19 +1200,19 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp)
 #if !defined _HAVE_STRING_ARCH_strsep || defined _FORCE_INLINES
 # ifndef _HAVE_STRING_ARCH_strsep
 
-extern char *__strsep_g (char **__stringp, __const char *__delim);
+extern char *__strsep_g (char **__stringp, const char *__delim);
 #  define __strsep(s, reject) \
   __extension__								      \
   ({ char __r0, __r1, __r2;						      \
      (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
-      && (__r0 = ((__const char *) (reject))[0],			      \
-	  ((__const char *) (reject))[0] != '\0')			      \
-      ? ((__r1 = ((__const char *) (reject))[1],			      \
-	 ((__const char *) (reject))[1] == '\0')			      \
+      && (__r0 = ((const char *) (reject))[0],				      \
+	  ((const char *) (reject))[0] != '\0')				      \
+      ? ((__r1 = ((const char *) (reject))[1],				      \
+	 ((const char *) (reject))[1] == '\0')				      \
 	 ? __strsep_1c (s, __r0)					      \
-	 : ((__r2 = ((__const char *) (reject))[2], __r2 == '\0')	      \
+	 : ((__r2 = ((const char *) (reject))[2], __r2 == '\0')		      \
 	    ? __strsep_2c (s, __r0, __r1)				      \
-	    : (((__const char *) (reject))[3] == '\0'			      \
+	    : (((const char *) (reject))[3] == '\0'			      \
 	       ? __strsep_3c (s, __r0, __r1, __r2)			      \
 	       : __strsep_g (s, reject))))				      \
       : __strsep_g (s, reject)); })
@@ -1300,10 +1299,10 @@ __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
 
 # ifndef _HAVE_STRING_ARCH_strdup
 
-extern char *__strdup (__const char *__string) __THROW __attribute_malloc__;
+extern char *__strdup (const char *__string) __THROW __attribute_malloc__;
 #  define __strdup(s) \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
-		  ? (((__const char *) (s))[0] == '\0'			      \
+		  ? (((const char *) (s))[0] == '\0'			      \
 		     ? (char *) calloc ((size_t) 1, (size_t) 1)		      \
 		     : ({ size_t __len = strlen (s) + 1;		      \
 			  char *__retval = (char *) malloc (__len);	      \
@@ -1319,11 +1318,11 @@ extern char *__strdup (__const char *__string) __THROW __attribute_malloc__;
 
 # ifndef _HAVE_STRING_ARCH_strndup
 
-extern char *__strndup (__const char *__string, size_t __n)
+extern char *__strndup (const char *__string, size_t __n)
      __THROW __attribute_malloc__;
 #  define __strndup(s, n) \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
-		  ? (((__const char *) (s))[0] == '\0'			      \
+		  ? (((const char *) (s))[0] == '\0'			      \
 		     ? (char *) calloc ((size_t) 1, (size_t) 1)		      \
 		     : ({ size_t __len = strlen (s) + 1;		      \
 			  size_t __n = (n);				      \
diff --git a/string/bits/string3.h b/string/bits/string3.h
index 164772572b..cdc01db53c 100644
--- a/string/bits/string3.h
+++ b/string/bits/string3.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2007, 2009, 2010, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,21 +46,21 @@ __warndecl (__warn_memset_zero_len,
 
 
 __extern_always_inline void *
-__NTH (memcpy (void *__restrict __dest, __const void *__restrict __src,
+__NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 	       size_t __len))
 {
   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
 }
 
 __extern_always_inline void *
-__NTH (memmove (void *__dest, __const void *__src, size_t __len))
+__NTH (memmove (void *__dest, const void *__src, size_t __len))
 {
   return __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
 }
 
 #ifdef __USE_GNU
 __extern_always_inline void *
-__NTH (mempcpy (void *__restrict __dest, __const void *__restrict __src,
+__NTH (mempcpy (void *__restrict __dest, const void *__restrict __src,
 		size_t __len))
 {
   return __builtin___mempcpy_chk (__dest, __src, __len, __bos0 (__dest));
@@ -87,7 +87,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len))
 
 #ifdef __USE_BSD
 __extern_always_inline void
-__NTH (bcopy (__const void *__src, void *__dest, size_t __len))
+__NTH (bcopy (const void *__src, void *__dest, size_t __len))
 {
   (void) __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
 }
@@ -100,14 +100,14 @@ __NTH (bzero (void *__dest, size_t __len))
 #endif
 
 __extern_always_inline char *
-__NTH (strcpy (char *__restrict __dest, __const char *__restrict __src))
+__NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 {
   return __builtin___strcpy_chk (__dest, __src, __bos (__dest));
 }
 
 #ifdef __USE_GNU
 __extern_always_inline char *
-__NTH (stpcpy (char *__restrict __dest, __const char *__restrict __src))
+__NTH (stpcpy (char *__restrict __dest, const char *__restrict __src))
 {
   return __builtin___stpcpy_chk (__dest, __src, __bos (__dest));
 }
@@ -115,21 +115,20 @@ __NTH (stpcpy (char *__restrict __dest, __const char *__restrict __src))
 
 
 __extern_always_inline char *
-__NTH (strncpy (char *__restrict __dest, __const char *__restrict __src,
+__NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
 		size_t __len))
 {
   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
 }
 
 // XXX We have no corresponding builtin yet.
-extern char *__stpncpy_chk (char *__dest, __const char *__src, size_t __n,
+extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
 			    size_t __destlen) __THROW;
-extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest,
-					       __const char *__src,
+extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src,
 					       size_t __n), stpncpy);
 
 __extern_always_inline char *
-__NTH (stpncpy (char *__dest, __const char *__src, size_t __n))
+__NTH (stpncpy (char *__dest, const char *__src, size_t __n))
 {
   if (__bos (__dest) != (size_t) -1
       && (!__builtin_constant_p (__n) || __n <= __bos (__dest)))
@@ -139,14 +138,14 @@ __NTH (stpncpy (char *__dest, __const char *__src, size_t __n))
 
 
 __extern_always_inline char *
-__NTH (strcat (char *__restrict __dest, __const char *__restrict __src))
+__NTH (strcat (char *__restrict __dest, const char *__restrict __src))
 {
   return __builtin___strcat_chk (__dest, __src, __bos (__dest));
 }
 
 
 __extern_always_inline char *
-__NTH (strncat (char *__restrict __dest, __const char *__restrict __src,
+__NTH (strncat (char *__restrict __dest, const char *__restrict __src,
 		size_t __len))
 {
   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
diff --git a/string/envz.h b/string/envz.h
index 3542ded721..29590253f8 100644
--- a/string/envz.h
+++ b/string/envz.h
@@ -1,5 +1,5 @@
 /* Routines for dealing with '\0' separated environment vectors
-   Copyright (C) 1995, 96, 98, 99, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995,1996,1998, 1999,2000,2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -31,14 +31,14 @@
 __BEGIN_DECLS
 
 /* Returns a pointer to the entry in ENVZ for NAME, or 0 if there is none.  */
-extern char *envz_entry (__const char *__restrict __envz, size_t __envz_len,
-			 __const char *__restrict __name)
+extern char *envz_entry (const char *__restrict __envz, size_t __envz_len,
+			 const char *__restrict __name)
      __THROW __attribute_pure__;
 
 /* Returns a pointer to the value portion of the entry in ENVZ for NAME, or 0
    if there is none.  */
-extern char *envz_get (__const char *__restrict __envz, size_t __envz_len,
-		       __const char *__restrict __name)
+extern char *envz_get (const char *__restrict __envz, size_t __envz_len,
+		       const char *__restrict __name)
      __THROW __attribute_pure__;
 
 /* Adds an entry for NAME with value VALUE to ENVZ & ENVZ_LEN.  If an entry
@@ -49,21 +49,21 @@ extern char *envz_get (__const char *__restrict __envz, size_t __envz_len,
    entry in the other one.  Null entries can be removed with envz_strip ().  */
 extern error_t envz_add (char **__restrict __envz,
 			 size_t *__restrict __envz_len,
-			 __const char *__restrict __name,
-			 __const char *__restrict __value) __THROW;
+			 const char *__restrict __name,
+			 const char *__restrict __value) __THROW;
 
 /* Adds each entry in ENVZ2 to ENVZ & ENVZ_LEN, as if with envz_add().  If
    OVERRIDE is true, then values in ENVZ2 will supersede those with the same
    name in ENV, otherwise not.  */
 extern error_t envz_merge (char **__restrict __envz,
 			   size_t *__restrict __envz_len,
-			   __const char *__restrict __envz2,
+			   const char *__restrict __envz2,
 			   size_t __envz2_len, int __override) __THROW;
 
 /* Remove the entry for NAME from ENVZ & ENVZ_LEN, if any.  */
 extern void envz_remove (char **__restrict __envz,
 			 size_t *__restrict __envz_len,
-			 __const char *__restrict __name) __THROW;
+			 const char *__restrict __name) __THROW;
 
 /* Remove null entries.  */
 extern void envz_strip (char **__restrict __envz,
diff --git a/string/string.h b/string/string.h
index 388402189f..63a1e76b2c 100644
--- a/string/string.h
+++ b/string/string.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,1995-2004,2007,2009,2010
+/* Copyright (C) 1991-1993,1995-2004,2007,2009,2010,2012
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -41,12 +41,11 @@ __BEGIN_DECLS
 
 __BEGIN_NAMESPACE_STD
 /* Copy N bytes of SRC to DEST.  */
-extern void *memcpy (void *__restrict __dest,
-		     __const void *__restrict __src, size_t __n)
-     __THROW __nonnull ((1, 2));
+extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
+		     size_t __n) __THROW __nonnull ((1, 2));
 /* Copy N bytes of SRC to DEST, guaranteeing
    correct behavior for overlapping strings.  */
-extern void *memmove (void *__dest, __const void *__src, size_t __n)
+extern void *memmove (void *__dest, const void *__src, size_t __n)
      __THROW __nonnull ((1, 2));
 __END_NAMESPACE_STD
 
@@ -54,7 +53,7 @@ __END_NAMESPACE_STD
    Return the position in DEST one byte past where C was copied,
    or NULL if C was not found in the first N bytes of SRC.  */
 #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
-extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
+extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
 		      int __c, size_t __n)
      __THROW __nonnull ((1, 2));
 #endif /* SVID.  */
@@ -65,7 +64,7 @@ __BEGIN_NAMESPACE_STD
 extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 
 /* Compare N bytes of S1 and S2.  */
-extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
+extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
 /* Search N bytes of S for C.  */
@@ -74,7 +73,7 @@ extern "C++"
 {
 extern void *memchr (void *__s, int __c, size_t __n)
       __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
-extern __const void *memchr (__const void *__s, int __c, size_t __n)
+extern const void *memchr (const void *__s, int __c, size_t __n)
       __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
 
 # ifdef __OPTIMIZE__
@@ -84,15 +83,15 @@ memchr (void *__s, int __c, size_t __n) __THROW
   return __builtin_memchr (__s, __c, __n);
 }
 
-__extern_always_inline __const void *
-memchr (__const void *__s, int __c, size_t __n) __THROW
+__extern_always_inline const void *
+memchr (const void *__s, int __c, size_t __n) __THROW
 {
   return __builtin_memchr (__s, __c, __n);
 }
 # endif
 }
 #else
-extern void *memchr (__const void *__s, int __c, size_t __n)
+extern void *memchr (const void *__s, int __c, size_t __n)
       __THROW __attribute_pure__ __nonnull ((1));
 #endif
 __END_NAMESPACE_STD
@@ -103,10 +102,10 @@ __END_NAMESPACE_STD
 # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++" void *rawmemchr (void *__s, int __c)
      __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1));
-extern "C++" __const void *rawmemchr (__const void *__s, int __c)
+extern "C++" const void *rawmemchr (const void *__s, int __c)
      __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1));
 # else
-extern void *rawmemchr (__const void *__s, int __c)
+extern void *rawmemchr (const void *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 # endif
 
@@ -114,10 +113,10 @@ extern void *rawmemchr (__const void *__s, int __c)
 # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++" void *memrchr (void *__s, int __c, size_t __n)
       __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1));
-extern "C++" __const void *memrchr (__const void *__s, int __c, size_t __n)
+extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
       __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1));
 # else
-extern void *memrchr (__const void *__s, int __c, size_t __n)
+extern void *memrchr (const void *__s, int __c, size_t __n)
       __THROW __attribute_pure__ __nonnull ((1));
 # endif
 #endif
@@ -125,33 +124,33 @@ extern void *memrchr (__const void *__s, int __c, size_t __n)
 
 __BEGIN_NAMESPACE_STD
 /* Copy SRC to DEST.  */
-extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
+extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      __THROW __nonnull ((1, 2));
 /* Copy no more than N characters of SRC to DEST.  */
 extern char *strncpy (char *__restrict __dest,
-		      __const char *__restrict __src, size_t __n)
+		      const char *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
 
 /* Append SRC onto DEST.  */
-extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
+extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      __THROW __nonnull ((1, 2));
 /* Append no more than N characters from SRC onto DEST.  */
-extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
+extern char *strncat (char *__restrict __dest, const char *__restrict __src,
 		      size_t __n) __THROW __nonnull ((1, 2));
 
 /* Compare S1 and S2.  */
-extern int strcmp (__const char *__s1, __const char *__s2)
+extern int strcmp (const char *__s1, const char *__s2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 /* Compare N characters of S1 and S2.  */
-extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
+extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
 /* Compare the collated forms of S1 and S2.  */
-extern int strcoll (__const char *__s1, __const char *__s2)
+extern int strcoll (const char *__s1, const char *__s2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 /* Put a transformation of SRC into no more than N bytes of DEST.  */
 extern size_t strxfrm (char *__restrict __dest,
-		       __const char *__restrict __src, size_t __n)
+		       const char *__restrict __src, size_t __n)
      __THROW __nonnull ((2));
 __END_NAMESPACE_STD
 
@@ -162,17 +161,17 @@ __END_NAMESPACE_STD
 # include <xlocale.h>
 
 /* Compare the collated forms of S1 and S2 using rules from L.  */
-extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
+extern int strcoll_l (const char *__s1, const char *__s2, __locale_t __l)
      __THROW __attribute_pure__ __nonnull ((1, 2, 3));
 /* Put a transformation of SRC into no more than N bytes of DEST.  */
-extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
+extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
 			 __locale_t __l) __THROW __nonnull ((2, 4));
 #endif
 
 #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED \
     || defined __USE_XOPEN2K8
 /* Duplicate S, returning an identical malloc'd string.  */
-extern char *strdup (__const char *__s)
+extern char *strdup (const char *__s)
      __THROW __attribute_malloc__ __nonnull ((1));
 #endif
 
@@ -180,7 +179,7 @@ extern char *strdup (__const char *__s)
    resultant string is terminated even if no null terminator
    appears before STRING[N].  */
 #if defined __USE_XOPEN2K8
-extern char *strndup (__const char *__string, size_t __n)
+extern char *strndup (const char *__string, size_t __n)
      __THROW __attribute_malloc__ __nonnull ((1));
 #endif
 
@@ -189,7 +188,7 @@ extern char *strndup (__const char *__string, size_t __n)
 # define strdupa(s)							      \
   (__extension__							      \
     ({									      \
-      __const char *__old = (s);					      \
+      const char *__old = (s);						      \
       size_t __len = strlen (__old) + 1;				      \
       char *__new = (char *) __builtin_alloca (__len);			      \
       (char *) memcpy (__new, __old, __len);				      \
@@ -199,7 +198,7 @@ extern char *strndup (__const char *__string, size_t __n)
 # define strndupa(s, n)							      \
   (__extension__							      \
     ({									      \
-      __const char *__old = (s);					      \
+      const char *__old = (s);						      \
       size_t __len = strnlen (__old, (n));				      \
       char *__new = (char *) __builtin_alloca (__len + 1);		      \
       __new[__len] = '\0';						      \
@@ -214,7 +213,7 @@ extern "C++"
 {
 extern char *strchr (char *__s, int __c)
      __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1));
-extern __const char *strchr (__const char *__s, int __c)
+extern const char *strchr (const char *__s, int __c)
      __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1));
 
 # ifdef __OPTIMIZE__
@@ -224,15 +223,15 @@ strchr (char *__s, int __c) __THROW
   return __builtin_strchr (__s, __c);
 }
 
-__extern_always_inline __const char *
-strchr (__const char *__s, int __c) __THROW
+__extern_always_inline const char *
+strchr (const char *__s, int __c) __THROW
 {
   return __builtin_strchr (__s, __c);
 }
 # endif
 }
 #else
-extern char *strchr (__const char *__s, int __c)
+extern char *strchr (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 #endif
 /* Find the last occurrence of C in S.  */
@@ -241,7 +240,7 @@ extern "C++"
 {
 extern char *strrchr (char *__s, int __c)
      __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1));
-extern __const char *strrchr (__const char *__s, int __c)
+extern const char *strrchr (const char *__s, int __c)
      __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1));
 
 # ifdef __OPTIMIZE__
@@ -251,15 +250,15 @@ strrchr (char *__s, int __c) __THROW
   return __builtin_strrchr (__s, __c);
 }
 
-__extern_always_inline __const char *
-strrchr (__const char *__s, int __c) __THROW
+__extern_always_inline const char *
+strrchr (const char *__s, int __c) __THROW
 {
   return __builtin_strrchr (__s, __c);
 }
 # endif
 }
 #else
-extern char *strrchr (__const char *__s, int __c)
+extern char *strrchr (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 #endif
 __END_NAMESPACE_STD
@@ -270,10 +269,10 @@ __END_NAMESPACE_STD
 # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++" char *strchrnul (char *__s, int __c)
      __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1));
-extern "C++" __const char *strchrnul (__const char *__s, int __c)
+extern "C++" const char *strchrnul (const char *__s, int __c)
      __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1));
 # else
-extern char *strchrnul (__const char *__s, int __c)
+extern char *strchrnul (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 # endif
 #endif
@@ -281,82 +280,81 @@ extern char *strchrnul (__const char *__s, int __c)
 __BEGIN_NAMESPACE_STD
 /* Return the length of the initial segment of S which
    consists entirely of characters not in REJECT.  */
-extern size_t strcspn (__const char *__s, __const char *__reject)
+extern size_t strcspn (const char *__s, const char *__reject)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 /* Return the length of the initial segment of S which
    consists entirely of characters in ACCEPT.  */
-extern size_t strspn (__const char *__s, __const char *__accept)
+extern size_t strspn (const char *__s, const char *__accept)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 /* Find the first occurrence in S of any character in ACCEPT.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
 {
-extern char *strpbrk (char *__s, __const char *__accept)
+extern char *strpbrk (char *__s, const char *__accept)
      __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2));
-extern __const char *strpbrk (__const char *__s, __const char *__accept)
+extern const char *strpbrk (const char *__s, const char *__accept)
      __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2));
 
 # ifdef __OPTIMIZE__
 __extern_always_inline char *
-strpbrk (char *__s, __const char *__accept) __THROW
+strpbrk (char *__s, const char *__accept) __THROW
 {
   return __builtin_strpbrk (__s, __accept);
 }
 
-__extern_always_inline __const char *
-strpbrk (__const char *__s, __const char *__accept) __THROW
+__extern_always_inline const char *
+strpbrk (const char *__s, const char *__accept) __THROW
 {
   return __builtin_strpbrk (__s, __accept);
 }
 # endif
 }
 #else
-extern char *strpbrk (__const char *__s, __const char *__accept)
+extern char *strpbrk (const char *__s, const char *__accept)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 #endif
 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
 #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++"
 {
-extern char *strstr (char *__haystack, __const char *__needle)
+extern char *strstr (char *__haystack, const char *__needle)
      __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2));
-extern __const char *strstr (__const char *__haystack,
-			     __const char *__needle)
+extern const char *strstr (const char *__haystack, const char *__needle)
      __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2));
 
 # ifdef __OPTIMIZE__
 __extern_always_inline char *
-strstr (char *__haystack, __const char *__needle) __THROW
+strstr (char *__haystack, const char *__needle) __THROW
 {
   return __builtin_strstr (__haystack, __needle);
 }
 
-__extern_always_inline __const char *
-strstr (__const char *__haystack, __const char *__needle) __THROW
+__extern_always_inline const char *
+strstr (const char *__haystack, const char *__needle) __THROW
 {
   return __builtin_strstr (__haystack, __needle);
 }
 # endif
 }
 #else
-extern char *strstr (__const char *__haystack, __const char *__needle)
+extern char *strstr (const char *__haystack, const char *__needle)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 #endif
 
 
 /* Divide S into tokens separated by characters in DELIM.  */
-extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
+extern char *strtok (char *__restrict __s, const char *__restrict __delim)
      __THROW __nonnull ((2));
 __END_NAMESPACE_STD
 
 /* Divide S into tokens separated by characters in DELIM.  Information
    passed between calls are stored in SAVE_PTR.  */
 extern char *__strtok_r (char *__restrict __s,
-			 __const char *__restrict __delim,
+			 const char *__restrict __delim,
 			 char **__restrict __save_ptr)
      __THROW __nonnull ((2, 3));
 #if defined __USE_POSIX || defined __USE_MISC
-extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
+extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
 		       char **__restrict __save_ptr)
      __THROW __nonnull ((2, 3));
 #endif
@@ -364,13 +362,13 @@ extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
 #ifdef __USE_GNU
 /* Similar to `strstr' but this function ignores the case of both strings.  */
 # ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++" char *strcasestr (char *__haystack, __const char *__needle)
+extern "C++" char *strcasestr (char *__haystack, const char *__needle)
      __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2));
-extern "C++" __const char *strcasestr (__const char *__haystack,
-				       __const char *__needle)
+extern "C++" const char *strcasestr (const char *__haystack,
+				     const char *__needle)
      __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2));
 # else
-extern char *strcasestr (__const char *__haystack, __const char *__needle)
+extern char *strcasestr (const char *__haystack, const char *__needle)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # endif
 #endif
@@ -379,31 +377,31 @@ extern char *strcasestr (__const char *__haystack, __const char *__needle)
 /* Find the first occurrence of NEEDLE in HAYSTACK.
    NEEDLE is NEEDLELEN bytes long;
    HAYSTACK is HAYSTACKLEN bytes long.  */
-extern void *memmem (__const void *__haystack, size_t __haystacklen,
-		     __const void *__needle, size_t __needlelen)
+extern void *memmem (const void *__haystack, size_t __haystacklen,
+		     const void *__needle, size_t __needlelen)
      __THROW __attribute_pure__ __nonnull ((1, 3));
 
 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
    last written byte.  */
 extern void *__mempcpy (void *__restrict __dest,
-			__const void *__restrict __src, size_t __n)
+			const void *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
 extern void *mempcpy (void *__restrict __dest,
-		      __const void *__restrict __src, size_t __n)
+		      const void *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
 #endif
 
 
 __BEGIN_NAMESPACE_STD
 /* Return the length of S.  */
-extern size_t strlen (__const char *__s)
+extern size_t strlen (const char *__s)
      __THROW __attribute_pure__ __nonnull ((1));
 __END_NAMESPACE_STD
 
 #ifdef	__USE_XOPEN2K8
 /* Find the length of STRING, but scan at most MAXLEN characters.
    If no '\0' terminator is found in that many characters, return MAXLEN.  */
-extern size_t strnlen (__const char *__string, size_t __maxlen)
+extern size_t strnlen (const char *__string, size_t __maxlen)
      __THROW __attribute_pure__ __nonnull ((1));
 #endif
 
@@ -452,14 +450,14 @@ extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
 
 #ifdef __USE_BSD
 /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
-extern void bcopy (__const void *__src, void *__dest, size_t __n)
+extern void bcopy (const void *__src, void *__dest, size_t __n)
      __THROW __nonnull ((1, 2));
 
 /* Set N bytes of S to 0.  */
 extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
 
 /* Compare N bytes of S1 and S2 (same as memcmp).  */
-extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+extern int bcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
 /* Find the first occurrence of C in S (same as strchr).  */
@@ -468,7 +466,7 @@ extern "C++"
 {
 extern char *index (char *__s, int __c)
      __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
-extern __const char *index (__const char *__s, int __c)
+extern const char *index (const char *__s, int __c)
      __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
 
 #  if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO
@@ -478,15 +476,15 @@ index (char *__s, int __c) __THROW
   return __builtin_index (__s, __c);
 }
 
-__extern_always_inline __const char *
-index (__const char *__s, int __c) __THROW
+__extern_always_inline const char *
+index (const char *__s, int __c) __THROW
 {
   return __builtin_index (__s, __c);
 }
 #  endif
 }
 # else
-extern char *index (__const char *__s, int __c)
+extern char *index (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 # endif
 
@@ -496,7 +494,7 @@ extern "C++"
 {
 extern char *rindex (char *__s, int __c)
      __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
-extern __const char *rindex (__const char *__s, int __c)
+extern const char *rindex (const char *__s, int __c)
      __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
 
 #  if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO
@@ -506,15 +504,15 @@ rindex (char *__s, int __c) __THROW
   return __builtin_rindex (__s, __c);
 }
 
-__extern_always_inline __const char *
-rindex (__const char *__s, int __c) __THROW
+__extern_always_inline const char *
+rindex (const char *__s, int __c) __THROW
 {
   return __builtin_rindex (__s, __c);
 }
 #endif
 }
 # else
-extern char *rindex (__const char *__s, int __c)
+extern char *rindex (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 # endif
 
@@ -533,22 +531,22 @@ __extension__ extern int ffsll (long long int __ll)
 # endif
 
 /* Compare S1 and S2, ignoring case.  */
-extern int strcasecmp (__const char *__s1, __const char *__s2)
+extern int strcasecmp (const char *__s1, const char *__s2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
 /* Compare no more than N chars of S1 and S2, ignoring case.  */
-extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 #endif /* Use BSD.  */
 
 #ifdef	__USE_GNU
 /* Again versions of a few functions which use the given locale instead
    of the global one.  */
-extern int strcasecmp_l (__const char *__s1, __const char *__s2,
+extern int strcasecmp_l (const char *__s1, const char *__s2,
 			 __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 3));
 
-extern int strncasecmp_l (__const char *__s1, __const char *__s2,
+extern int strncasecmp_l (const char *__s1, const char *__s2,
 			  size_t __n, __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 4));
 #endif
@@ -557,7 +555,7 @@ extern int strncasecmp_l (__const char *__s1, __const char *__s2,
 /* Return the next DELIM-delimited token from *STRINGP,
    terminating it with a '\0', and update *STRINGP to point past it.  */
 extern char *strsep (char **__restrict __stringp,
-		     __const char *__restrict __delim)
+		     const char *__restrict __delim)
      __THROW __nonnull ((1, 2));
 #endif
 
@@ -566,24 +564,24 @@ extern char *strsep (char **__restrict __stringp,
 extern char *strsignal (int __sig) __THROW;
 
 /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
-extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
+extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
      __THROW __nonnull ((1, 2));
-extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
+extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
      __THROW __nonnull ((1, 2));
 
 /* Copy no more than N characters of SRC to DEST, returning the address of
    the last character written into DEST.  */
 extern char *__stpncpy (char *__restrict __dest,
-			__const char *__restrict __src, size_t __n)
+			const char *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
 extern char *stpncpy (char *__restrict __dest,
-		      __const char *__restrict __src, size_t __n)
+		      const char *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
 #endif
 
 #ifdef	__USE_GNU
 /* Compare S1 and S2 as strings holding name & indices/version numbers.  */
-extern int strverscmp (__const char *__s1, __const char *__s2)
+extern int strverscmp (const char *__s1, const char *__s2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
 /* Sautee STRING briskly.  */
@@ -600,10 +598,10 @@ extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1));
 #  ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
 extern "C++" char *basename (char *__filename)
      __THROW __asm ("basename") __nonnull ((1));
-extern "C++" __const char *basename (__const char *__filename)
+extern "C++" const char *basename (const char *__filename)
      __THROW __asm ("basename") __nonnull ((1));
 #  else
-extern char *basename (__const char *__filename) __THROW __nonnull ((1));
+extern char *basename (const char *__filename) __THROW __nonnull ((1));
 #  endif
 # endif
 #endif
diff --git a/string/strings.h b/string/strings.h
index 2ab83caa06..c352afa74b 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1996,1997,1999,2000,2001,2009,2010
+/* Copyright (C) 1991,1992,1996,1997,1999,2000,2001,2009,2010,2012
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -38,11 +38,11 @@ __BEGIN_DECLS
 
 # if defined __USE_MISC || !defined __USE_XOPEN2K8
 /* Compare N bytes of S1 and S2 (same as memcmp).  */
-extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+extern int bcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__;
 
 /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
-extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;
+extern void bcopy (const void *__src, void *__dest, size_t __n) __THROW;
 
 /* Set N bytes of S to 0.  */
 extern void bzero (void *__s, size_t __n) __THROW;
@@ -53,7 +53,7 @@ extern "C++"
 {
 extern char *index (char *__s, int __c)
      __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
-extern __const char *index (__const char *__s, int __c)
+extern const char *index (const char *__s, int __c)
      __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
 
 #   if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO
@@ -63,15 +63,15 @@ index (char *__s, int __c) __THROW
   return __builtin_index (__s, __c);
 }
 
-__extern_always_inline __const char *
-index (__const char *__s, int __c) __THROW
+__extern_always_inline const char *
+index (const char *__s, int __c) __THROW
 {
   return __builtin_index (__s, __c);
 }
 #   endif
 }
 #  else
-extern char *index (__const char *__s, int __c)
+extern char *index (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 #  endif
 
@@ -81,7 +81,7 @@ extern "C++"
 {
 extern char *rindex (char *__s, int __c)
      __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
-extern __const char *rindex (__const char *__s, int __c)
+extern const char *rindex (const char *__s, int __c)
      __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
 
 #   if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO
@@ -91,15 +91,15 @@ rindex (char *__s, int __c) __THROW
   return __builtin_rindex (__s, __c);
 }
 
-__extern_always_inline __const char *
-rindex (__const char *__s, int __c) __THROW
+__extern_always_inline const char *
+rindex (const char *__s, int __c) __THROW
 {
   return __builtin_rindex (__s, __c);
 }
 #   endif
 }
 #  else
-extern char *rindex (__const char *__s, int __c)
+extern char *rindex (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
 #  endif
 # endif
@@ -111,11 +111,11 @@ extern int ffs (int __i) __THROW __attribute__ ((const));
 #endif
 
 /* Compare S1 and S2, ignoring case.  */
-extern int strcasecmp (__const char *__s1, __const char *__s2)
+extern int strcasecmp (const char *__s1, const char *__s2)
      __THROW __attribute_pure__;
 
 /* Compare no more than N chars of S1 and S2, ignoring case.  */
-extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
      __THROW __attribute_pure__;
 
 #ifdef	__USE_XOPEN2K8
@@ -126,11 +126,10 @@ extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
 
 /* Again versions of a few functions which use the given locale instead
    of the global one.  */
-extern int strcasecmp_l (__const char *__s1, __const char *__s2,
-			 __locale_t __loc)
+extern int strcasecmp_l (const char *__s1, const char *__s2, __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 3));
 
-extern int strncasecmp_l (__const char *__s1, __const char *__s2,
+extern int strncasecmp_l (const char *__s1, const char *__s2,
 			  size_t __n, __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 4));
 #endif