This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix -D_FORTIFY_SOURCE memmove and bcopy


On Thu, Dec 09, 2010 at 05:00:10PM -0800, Paul Eggert wrote:
> Thanks for catching that.  Does wmemmove need a similar
> fix, in wcsmbs/bits/wchar.h?

Oops, thanks for pointing that out.  I was grepping for other
__restrict uses in bits/*.h, but apparently not carefully enough...

2010-12-10  Jakub Jelinek  <jakub@redhat.com>

	* wcsmbs/bits/wchar2.h (__wmemmove_chk_warn, wmemmove, wmemset):
	Remove __restrict.

--- libc/wcsmbs/bits/wchar2.h
+++ libc/wcsmbs/bits/wchar2.h
@@ -1,5 +1,5 @@
 /* Checking macros for wchar functions.
-   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2007, 2010 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
@@ -60,15 +60,13 @@ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
 						   __const wchar_t *__s2,
 						   size_t __n), wmemmove);
 extern wchar_t *__REDIRECT_NTH (__wmemmove_chk_warn,
-				(wchar_t *__restrict __s1,
-				 __const wchar_t *__restrict __s2, size_t __n,
-				 size_t __ns1), __wmemmove_chk)
+				(wchar_t *__s1, __const wchar_t *__s2,
+				 size_t __n, size_t __ns1), __wmemmove_chk)
      __warnattr ("wmemmove called with length bigger than size of destination "
 		 "buffer");
 
 __extern_always_inline wchar_t *
-__NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
-		 size_t __n))
+__NTH (wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n))
 {
   if (__bos0 (__s1) != (size_t) -1)
     {
@@ -129,7 +127,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
 		 "buffer");
 
 __extern_always_inline wchar_t *
-__NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
+__NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
 {
   if (__bos0 (__s) != (size_t) -1)
     {


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]