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]

[PATCH][BZ #18265] Updated annotations for wcscpy and wcsncpy


Hello!

My previous patch (https://sourceware.org/ml/libc-alpha/2015-04/msg00366.html) has not been reviewed.

I think that maybe my patch was too big.

Therefore I try to break out a few changes. This patch is much shorter, I only update the annotations for wcscpy and wcsncpy.

After this patch the annotations for wcscpy and wcsncpy will match the annoations for strcpy and strncpy. This is copy/pasted from string/string.h:

/* Copy SRC to DEST.  */
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)
     __THROW __nonnull ((1, 2));

I hope this is much easier and quicker for you to review and that it therefore feels safer to accept and commit.

Best regards,
Daniel Marjamäki

..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden

Mobile:                 +46 (0)709 12 42 62
E-mail:                 Daniel.Marjamaki@evidente.se

www.evidente.se
diff --git a/ChangeLog b/ChangeLog
index cf5a52c..1083848 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-30  Daniel Marjamäki  <daniel.marjamaki@evidente.se>
+
+	[BZ #18265]
+	* wcsmbs/wchar.h: update annotations for wcscpy and wcsncpy
+
 2015-04-29  Roland McGrath  <roland@hack.frob.com>
 
 	* sysdeps/nacl/bits/typesizes.h (__CLOCK_T_TYPE): Use __SLONGWORD_TYPE.
diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
index 9652f65..0d68cda 100644
--- a/wcsmbs/wchar.h
+++ b/wcsmbs/wchar.h
@@ -145,11 +145,13 @@ __USING_NAMESPACE_STD(tm)
 __BEGIN_NAMESPACE_STD
 /* Copy SRC to DEST.  */
 extern wchar_t *wcscpy (wchar_t *__restrict __dest,
-			const wchar_t *__restrict __src) __THROW;
+			const wchar_t *__restrict __src)
+     __THROW __nonnull ((1, 2));
+
 /* Copy no more than N wide-characters of SRC to DEST.  */
 extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
 			 const wchar_t *__restrict __src, size_t __n)
-     __THROW;
+     __THROW __nonnull ((1, 2));
 
 /* Append SRC onto DEST.  */
 extern wchar_t *wcscat (wchar_t *__restrict __dest,

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