changeset 10011:d266f32e62b2

Silence valgrind on safe reads beyond potential array bounds. * lib/rawmemchr.valgrind: New file. * lib/strchrnul.valgrind: Likewise. * modules/rawmemchr (Files): Distribute new file. * modules/strchrnul (Files): Likewise. Suggested by Bruno Haible. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Tue, 29 Apr 2008 06:08:44 -0600
parents d26ac8a528f7
children 2d1d93581ac2
files ChangeLog lib/rawmemchr.valgrind lib/strchrnul.valgrind modules/rawmemchr modules/strchrnul
diffstat 5 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-29  Eric Blake  <ebb9@byu.net>
+
+	Silence valgrind on safe reads beyond potential array bounds.
+	* lib/rawmemchr.valgrind: New file.
+	* lib/strchrnul.valgrind: Likewise.
+	* modules/rawmemchr (Files): Distribute new file.
+	* modules/strchrnul (Files): Likewise.
+	Suggested by Bruno Haible.
+
 2008-04-29  Bruno Haible  <bruno@clisp.org>
 
 	* lib/arpa_inet.in.h: Include system's <arpa/inet.h> if it exists.
new file mode 100644
--- /dev/null
+++ b/lib/rawmemchr.valgrind
@@ -0,0 +1,12 @@
+# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
+# This use is OK because it provides only a speedup.
+{
+    rawmemchr-value4
+    Memcheck:Value4
+    fun:rawmemchr
+}
+{
+    rawmemchr-value8
+    Memcheck:Value8
+    fun:rawmemchr
+}
new file mode 100644
--- /dev/null
+++ b/lib/strchrnul.valgrind
@@ -0,0 +1,12 @@
+# Suppress a valgrind message about use of uninitialized memory in strchrnul().
+# This use is OK because it provides only a speedup.
+{
+    strchrnul-value4
+    Memcheck:Value4
+    fun:strchrnul
+}
+{
+    strchrnul-value8
+    Memcheck:Value8
+    fun:strchrnul
+}
--- a/modules/rawmemchr
+++ b/modules/rawmemchr
@@ -3,6 +3,7 @@
 
 Files:
 lib/rawmemchr.c
+lib/rawmemchr.valgrind
 m4/rawmemchr.m4
 
 Depends-on:
--- a/modules/strchrnul
+++ b/modules/strchrnul
@@ -4,6 +4,7 @@
 
 Files:
 lib/strchrnul.c
+lib/strchrnul.valgrind
 m4/strchrnul.m4
 
 Depends-on: