Bug#674917: libc6-dev: mblen is erroneously marked warn_unused_result
tags 674917 + upstream patch
quit
Hi,
Antti-Juhani Kaijanaho wrote:
> However, so far as I can see, ignoring the return value of mblen is never a
> security problem and is sometimes appropriate (the first call to the function
> is often mblen(NULL, 0), the result value of which is usually of no interest).
This doesn't seem to be fixed upstream, so please report it to
<http://sourceware.org/bugzilla>, product glibc, component libc and
let us know the bug number so we can track it.
> (Debian's use of -D_FORTIFY_SOURCE=2 and the common policy of using -Werror
> together make this a noncosmetic issue.)
Using -Werror in contexts other than private development where you
control the toolchain and can easily suppress known warnings is not
very wise.
Thanks and hope that helps,
Jonathan
* stdlib/stdlib.h (mblen): Remove __wur.
It is not necessarily an error to ignore the return value from
mblen(NULL, 0) which resets the shift state.
diff --git i/stdlib/stdlib.h w/stdlib/stdlib.h
index f652eda3..f14ec0e3 100644
--- i/stdlib/stdlib.h
+++ w/stdlib/stdlib.h
@@ -859,7 +859,7 @@ extern int qfcvt_r (long double __value, int __ndigit,
__BEGIN_NAMESPACE_STD
/* Return the length of the multibyte character
in S, which is no longer than N. */
-extern int mblen (const char *__s, size_t __n) __THROW __wur;
+extern int mblen (const char *__s, size_t __n) __THROW;
/* Return the length of the given multibyte character,
putting its `wchar_t' representation in *PWC. */
extern int mbtowc (wchar_t *__restrict __pwc,
Reply to: