From 94ed569cdce9dc0df6a37b0b3a513e67f19b50f3 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 23 Feb 2009 07:17:08 +0000 Subject: [PATCH] Fix some more 'make check' warnings, ones that appear on non-Linux platforms. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9238 --- massif/tests/malloc_usable.c | 2 +- memcheck/tests/malloc_usable.c | 4 ++-- memcheck/tests/memalign2.c | 8 ++++---- none/tests/rlimit_nofile.c | 5 +++-- none/tests/susphello.c | 2 +- perf/tinycc.c | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/massif/tests/malloc_usable.c b/massif/tests/malloc_usable.c index e825e3d98b..e2524160db 100644 --- a/massif/tests/malloc_usable.c +++ b/massif/tests/malloc_usable.c @@ -5,12 +5,12 @@ int main(void) { +# if !defined(_AIX) // Because our allocations are in multiples of 8 or 16, 99 will round up // to 104 or 112. int* x = malloc(99); // XXX: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here -# if !defined(_AIX) assert(104 == malloc_usable_size(x) || 112 == malloc_usable_size(x)); assert( 0 == malloc_usable_size(NULL)); diff --git a/memcheck/tests/malloc_usable.c b/memcheck/tests/malloc_usable.c index 8055c95d2f..7e912dd7bf 100644 --- a/memcheck/tests/malloc_usable.c +++ b/memcheck/tests/malloc_usable.c @@ -5,12 +5,12 @@ int main(void) { +# if !defined(_AIX) // Because Memcheck marks any slop as inaccessible, it doesn't round up // sizes for malloc_usable_size(). int* x = malloc(99); - // DDD: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here -# if !defined(_AIX) + // XXX: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here assert(99 == malloc_usable_size(x)); assert( 0 == malloc_usable_size(NULL)); assert( 0 == malloc_usable_size((void*)0xdeadbeef)); diff --git a/memcheck/tests/memalign2.c b/memcheck/tests/memalign2.c index daddb25494..473c924d51 100644 --- a/memcheck/tests/memalign2.c +++ b/memcheck/tests/memalign2.c @@ -19,6 +19,10 @@ int main ( void ) { +# if defined(_AIX) + printf("AIX 5.2 knows about neither memalign() nor posix_memalign().\n"); + +# else // Nb: assuming VG_MIN_MALLOC_SZB is 8! // Should work with both 32-bit and 64-bit pointers, though. @@ -26,10 +30,6 @@ int main ( void ) int res; assert(sizeof(long int) == sizeof(void*)); -# if defined(_AIX) - printf("AIX 5.2 knows about neither memalign() nor posix_memalign().\n"); - -# else p = memalign(0, 100); assert(0 == (long)p % 8); p = memalign(1, 100); assert(0 == (long)p % 8); p = memalign(2, 100); assert(0 == (long)p % 8); diff --git a/none/tests/rlimit_nofile.c b/none/tests/rlimit_nofile.c index c563c5f304..2d8304e883 100644 --- a/none/tests/rlimit_nofile.c +++ b/none/tests/rlimit_nofile.c @@ -37,8 +37,9 @@ int main(int argc, char **argv) if (newrlim.rlim_cur != oldrlim.rlim_cur / 2) { - fprintf(stderr, "rlim_cur is %lu (should be %lu)\n", - newrlim.rlim_cur, oldrlim.rlim_cur / 2); + fprintf(stderr, "rlim_cur is %llu (should be %llu)\n", + (unsigned long long)newrlim.rlim_cur, + (unsigned long long)oldrlim.rlim_cur / 2); } if (newrlim.rlim_max != oldrlim.rlim_max) diff --git a/none/tests/susphello.c b/none/tests/susphello.c index b0d53fdc8e..e0e29c31df 100644 --- a/none/tests/susphello.c +++ b/none/tests/susphello.c @@ -20,7 +20,7 @@ #include #include - +#include #include #include #include diff --git a/perf/tinycc.c b/perf/tinycc.c index 5bef0664f8..0a59cc3c88 100644 --- a/perf/tinycc.c +++ b/perf/tinycc.c @@ -20606,7 +20606,7 @@ static int rt_get_caller_pc(unsigned long *paddr, void rt_error(ucontext_t *uc, const char *fmt, ...) { va_list ap; - unsigned long pc; + unsigned long pc = 0; // shut gcc up int i; va_start(ap, fmt); -- 2.47.3