From f54ab4c77f02cdc8fc480d2bb0aa406eb8ff9039 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 29 Apr 2008 06:08:44 -0600 Subject: [PATCH] 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 --- ChangeLog | 9 +++++++++ lib/rawmemchr.valgrind | 12 ++++++++++++ lib/strchrnul.valgrind | 12 ++++++++++++ modules/rawmemchr | 1 + modules/strchrnul | 1 + 5 files changed, 35 insertions(+) create mode 100644 lib/rawmemchr.valgrind create mode 100644 lib/strchrnul.valgrind diff --git a/ChangeLog b/ChangeLog index ceaee0794..ed3c2106a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-04-29 Eric Blake + + 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 * lib/arpa_inet.in.h: Include system's if it exists. diff --git a/lib/rawmemchr.valgrind b/lib/rawmemchr.valgrind new file mode 100644 index 000000000..636392368 --- /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 +} diff --git a/lib/strchrnul.valgrind b/lib/strchrnul.valgrind new file mode 100644 index 000000000..b14fa1304 --- /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 +} diff --git a/modules/rawmemchr b/modules/rawmemchr index bcbe7e8f4..d8fdbbbb7 100644 --- a/modules/rawmemchr +++ b/modules/rawmemchr @@ -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: diff --git a/modules/strchrnul b/modules/strchrnul index 290176814..2f7545060 100644 --- a/modules/strchrnul +++ b/modules/strchrnul @@ -4,6 +4,7 @@ byte. Files: lib/strchrnul.c +lib/strchrnul.valgrind m4/strchrnul.m4 Depends-on: -- 2.11.0