This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Add __wur for GNU strerror_r()
Hi!
> > > That seems like a sensible change to me. It needs a proper ChangeLog
> > > entry. As it's a feature change rather than a bug fix per se, it will
> > > wait until after the 2.16 freeze unless Carlos deems otherwise.
> >
> > That sounds reasonable to me.
> >
> > Should I send another patch with a ChangeLog entry?
>
> Yes, please.
Attached, hope it's done right.
The date in the entry is set to the date when I did send the original
patch, let me know if this should be changed to anything else.
--
Cyril Hrubis
chrubis@suse.cz
>From becea8b957b47f05bc46bf743812767b21450fec Mon Sep 17 00:00:00 2001
From: Cyril Hrubis <metan@ucw.cz>
Date: Thu, 7 Jun 2012 14:57:02 +0200
Subject: [PATCH] Add __wur to GNU version of strerror_r.
Not using the result of the GNU strerror_r() is always a mistake.
Moreover this would generate warning if XSI version was expected but GNU
version was used instead (because some random used header defined
_GNU_SOURCE which was Python.h in this case).
Signed-off-by: Cyril Hrubis <metan@ucw.cz>
2012-06-07 Cyril Hrubis <metan@ucw.cz>
* string/string.h: add __wur to GNU version of strerror_r.
---
string/string.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/string/string.h b/string/string.h
index 7bb505f..83742ff 100644
--- a/string/string.h
+++ b/string/string.h
@@ -433,7 +433,7 @@ extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
/* If a temporary buffer is required, at most BUFLEN bytes of BUF will be
used. */
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
- __THROW __nonnull ((2));
+ __THROW __nonnull ((2)) __wur;
# endif
#endif
--
1.7.3.4