[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: memchr and valgrind
From: |
Eric Blake |
Subject: |
Re: memchr and valgrind |
Date: |
Mon, 15 Jun 2009 21:06:45 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 6/15/2009 11:42 AM:
> With the recent clarification on memchr behavior, it is conceivable that we
> could trip false positives under valgrind when using memchr to find the
> location of a known byte with an overestimated length (most frequently when
> searching for a NUL). Any objections to applying this patch?
Committed, along with an exception for memchr2 (which, by extension to
memchr, should likewise be safe to use with an overestimated length). I
also did another trivial patch:
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAko3DEUACgkQ84KuGfSFAYBJvgCfZY6nS3GwFUtFz43N0g8oreoV
CDgAniTjWyAkfdF0JDcRVBcslKHpc0y3
=xaKM
-----END PGP SIGNATURE-----
>From e06226e32481672ab9321d5caddee63fe1dab720 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 15 Jun 2009 07:49:35 -0600
Subject: [PATCH] docs: memchr is no longer obsolete
* MODULES.html.sh: Move memchr from obsolete to string.h section.
* lib/string.in.h (memchr): Simplify logic.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 6 ++++++
MODULES.html.sh | 2 +-
lib/string.in.h | 2 --
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f88670c..5bcd64d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-15 Eric Blake <address@hidden>
+
+ docs: memchr is no longer obsolete
+ * MODULES.html.sh: Move memchr from obsolete to string.h section.
+ * lib/string.in.h (memchr): Simplify logic.
+
2009-06-14 Jim Meyering <address@hidden>
link-follow: fix the "checking..." message to not mention trailing slash
diff --git a/MODULES.html.sh b/MODULES.html.sh
index 06afa2d..5899151 100755
--- a/MODULES.html.sh
+++ b/MODULES.html.sh
@@ -1606,7 +1606,6 @@ func_all_modules ()
func_module exit
func_module strtol
func_module strtoul
- func_module memchr
func_module memcmp
func_module memcpy
func_module memmove
@@ -1770,6 +1769,7 @@ func_all_modules ()
func_begin_table
func_module bcopy
+ func_module memchr
func_module memchr2
func_module memmem
func_module memmem-simple
diff --git a/lib/string.in.h b/lib/string.in.h
index c913cce..9f98b0d 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -53,8 +53,6 @@ extern "C" {
#if @GNULIB_MEMCHR@
# if @REPLACE_MEMCHR@
# define memchr rpl_memchr
-# endif
-# if @REPLACE_MEMCHR@
extern void *memchr (void const *__s, int __c, size_t __n)
__attribute__ ((__pure__));
# endif
--
1.6.3.rc3.2.g4b51