Silence valgrind on safe reads beyond potential array bounds.
authorEric Blake <ebb9@byu.net>
Tue, 29 Apr 2008 12:08:44 +0000 (06:08 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 29 Apr 2008 12:31:57 +0000 (06:31 -0600)
* 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>
ChangeLog
lib/rawmemchr.valgrind [new file with mode: 0644]
lib/strchrnul.valgrind [new file with mode: 0644]
modules/rawmemchr
modules/strchrnul

index ceaee07..ed3c210 100644 (file)
--- 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.
diff --git a/lib/rawmemchr.valgrind b/lib/rawmemchr.valgrind
new file mode 100644 (file)
index 0000000..6363923
--- /dev/null
@@ -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
+}
diff --git a/lib/strchrnul.valgrind b/lib/strchrnul.valgrind
new file mode 100644 (file)
index 0000000..b14fa13
--- /dev/null
@@ -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
+}
index bcbe7e8..d8fdbbb 100644 (file)
@@ -3,6 +3,7 @@ rawmemchr() function: Find the first occurrence of C in S.
 
 Files:
 lib/rawmemchr.c
+lib/rawmemchr.valgrind
 m4/rawmemchr.m4
 
 Depends-on:
index 2901768..2f75450 100644 (file)
@@ -4,6 +4,7 @@ byte.
 
 Files:
 lib/strchrnul.c
+lib/strchrnul.valgrind
 m4/strchrnul.m4
 
 Depends-on: