aboutsummaryrefslogtreecommitdiff
path: root/string/bits
diff options
context:
space:
mode:
authorCaolan McNamara <caolanm@redhat.com>2009-11-10 06:29:13 -0800
committerUlrich Drepper <drepper@redhat.com>2009-11-10 06:29:13 -0800
commit6515a01fc1d35d329886d5a45435537ee9115bc4 (patch)
treedda237929d3af3a0a2cb24ea4c0bc6ff6a218cbe /string/bits
parent639d6699e9943c393f5fb5a9b84ab24e20bb7a93 (diff)
downloadglibc-6515a01fc1d35d329886d5a45435537ee9115bc4.zip
glibc-6515a01fc1d35d329886d5a45435537ee9115bc4.tar.gz
glibc-6515a01fc1d35d329886d5a45435537ee9115bc4.tar.bz2
Avoid memset warning in one case.
Diffstat (limited to 'string/bits')
-rw-r--r--string/bits/string3.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/string/bits/string3.h b/string/bits/string3.h
index a5593e3..1d759f1 100644
--- a/string/bits/string3.h
+++ b/string/bits/string3.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2007, 2009 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
@@ -77,7 +77,8 @@ __NTH (mempcpy (void *__restrict __dest, __const void *__restrict __src,
__extern_always_inline void *
__NTH (memset (void *__dest, int __ch, size_t __len))
{
- if (__builtin_constant_p (__len) && __len == 0)
+ if (__builtin_constant_p (__len) && __len == 0
+ && (!__builtin_constant_p (__ch) || __ch != 0))
{
__warn_memset_zero_len ();
return __dest;