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 ceaee0794eda85c4db73630b4e3643eadf5735b5..ed3c2106a9bd08fdd4be4558956470b4088becb0 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 bcbe7e8f425f1883ad9054f87326ddd974a9c8f8..d8fdbbbb7a95215b373b75d90c891b22d0b6e182 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 290176814d08c175cee06f24d283079915824692..2f75450606967e42f9e4966a4aa9a753e5109c7d 100644 (file)
@@ -4,6 +4,7 @@ byte.
 
 Files:
 lib/strchrnul.c
+lib/strchrnul.valgrind
 m4/strchrnul.m4
 
 Depends-on: