portability


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2171 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/corecheck/tests/.cvsignore b/corecheck/tests/.cvsignore
index 1247d1c..4bbf819 100644
--- a/corecheck/tests/.cvsignore
+++ b/corecheck/tests/.cvsignore
@@ -26,3 +26,5 @@
 fdleak_socketpair
 pth_exit
 vgprintf
+as_shm
+as_mmap
diff --git a/corecheck/tests/as_shm.c b/corecheck/tests/as_shm.c
index 2c86cb6..30abc66 100644
--- a/corecheck/tests/as_shm.c
+++ b/corecheck/tests/as_shm.c
@@ -1,3 +1,4 @@
+#include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <stdio.h>
diff --git a/corecheck/tests/filter_fdleak b/corecheck/tests/filter_fdleak
index cfb8096..6dc585e 100755
--- a/corecheck/tests/filter_fdleak
+++ b/corecheck/tests/filter_fdleak
@@ -8,7 +8,7 @@
 $dir/../../tests/filter_addresses                       |
 
 # Anonymise line numbers in mac_replace_strmem.c
-sed "s/mac_replace_strmem.c:[0-9]\+/mac_replace_strmem.c:.../"  |
+sed "s/mac_replace_strmem.c:[0-9]*/mac_replace_strmem.c:.../"  |
 
 $dir/../../tests/filter_test_paths                      |
 
@@ -18,9 +18,9 @@
 # Anonymise paths like "__libc_start_main (../foo/bar/libc-quux.c:129)"
 sed "s/__libc_\(.*\) (.*)$/__libc_\1 (...libc...)/"	|
 
-sed s/"^Open AF_UNIX socket [0-9]\+: <unknown>/Open AF_UNIX socket .: <unknown>/" |
-sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]\+: \/dev\/null/Open \\1 .: \/dev\/null/" |
-sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]\+: \/tmp\/\(sock\|data1\|data2\|file\)\.[0-9]\+/Open \\1 .: \/tmp\/\\2/" |
-sed s/"^Open file descriptor [0-9]\+: .*/Open file descriptor .: ./" |
-sed s/"^Open file descriptor [0-9]\+:$/Open file descriptor .:/" |
-sed s/"127.0.0.1:[0-9]\+/127.0.0.1:.../g"
+sed s/"^Open AF_UNIX socket [0-9]*: <unknown>/Open AF_UNIX socket .: <unknown>/" |
+sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]*: \/dev\/null/Open \\1 .: \/dev\/null/" |
+sed s/"^Open \(AF_UNIX socket\|file descriptor\) [0-9]*: \/tmp\/\(sock\|data1\|data2\|file\)\.[0-9]*/Open \\1 .: \/tmp\/\\2/" |
+sed s/"^Open file descriptor [0-9]*: .*/Open file descriptor .: ./" |
+sed s/"^Open file descriptor [0-9]*:$/Open file descriptor .:/" |
+sed s/"127.0.0.1:[0-9]*/127.0.0.1:.../g"
diff --git a/tests/filter_addresses b/tests/filter_addresses
index 2ea84cc..ca70e5b 100755
--- a/tests/filter_addresses
+++ b/tests/filter_addresses
@@ -1,4 +1,4 @@
 #! /bin/sh
 
-sed "s/0x[0-9A-Fa-f]\+/0x......../g"
+sed "s/0x[0-9A-Fa-f]*/0x......../g"
 
diff --git a/tests/filter_stderr_basic b/tests/filter_stderr_basic
index ba07f02..b629a54 100755
--- a/tests/filter_stderr_basic
+++ b/tests/filter_stderr_basic
@@ -4,27 +4,27 @@
 # startup stuff and pid numbers.
 
 # Remove ==pid== and --pid-- and ++pid++ and **pid** strings 
-sed "s/\(==\|--\|\+\+\|\*\*\)[0-9]\{1,5\}\1 //"                            |
+sed -E "s/(==|--|\+\+|\*\*)[0-9]{1,5}(==|--|\+\+|\*\*) //"             |
 
 # Remove "<name>, a <description> for x86-linux." line and the following
 # copyright notice line.  Works for skin and core intro lines.
 sed "/^.*, .* for x86-linux\./ , /./ d"                                | 
 
 # Remove other introductory lines
-sed "/Estimated CPU clock rate is [0-9]\+ MHz/d"                       |
+sed "/Estimated CPU clock rate is [0-9]* MHz/d"                       |
 sed "/For more details, rerun with: -v/d"                              |
 
 # Anonymise line numbers in vg_replace_malloc.c
-sed "s/vg_replace_malloc.c:[0-9]\+/vg_replace_malloc.c:.../"           |
+sed "s/vg_replace_malloc.c:[0-9]*/vg_replace_malloc.c:.../"           |
 
 # Anonymise vg_intercept lines
-sed "s/vg_intercept.c:[0-9]\+/vg_intercept.c:.../"                     |
+sed "s/vg_intercept.c:[0-9]*/vg_intercept.c:.../"                     |
 
 # Anonymise vg_libpthread lines
-sed "s/vg_libpthread.c:[0-9]\+/vg_libpthread.c:.../"                   |
+sed "s/vg_libpthread.c:[0-9]*/vg_libpthread.c:.../"                   |
 
 # Hide suppressed error counts
-sed "s/^\(ERROR SUMMARY[^(]*(suppressed: \)[0-9]\+\( from \)[0-9]\+)$/\10\20)/" |
+sed "s/^\(ERROR SUMMARY[^(]*(suppressed: \)[0-9]*\( from \)[0-9]*)$/\10\20)/" |
 
 
 # Reduce some libc incompatibility