|
From: <sv...@va...> - 2009-02-23 07:17:12
|
Author: njn
Date: 2009-02-23 07:17:08 +0000 (Mon, 23 Feb 2009)
New Revision: 9238
Log:
Fix some more 'make check' warnings, ones that appear on non-Linux
platforms.
Modified:
trunk/massif/tests/malloc_usable.c
trunk/memcheck/tests/malloc_usable.c
trunk/memcheck/tests/memalign2.c
trunk/none/tests/rlimit_nofile.c
trunk/none/tests/susphello.c
trunk/perf/tinycc.c
Modified: trunk/massif/tests/malloc_usable.c
===================================================================
--- trunk/massif/tests/malloc_usable.c 2009-02-23 06:44:51 UTC (rev 9237)
+++ trunk/massif/tests/malloc_usable.c 2009-02-23 07:17:08 UTC (rev 9238)
@@ -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));
Modified: trunk/memcheck/tests/malloc_usable.c
===================================================================
--- trunk/memcheck/tests/malloc_usable.c 2009-02-23 06:44:51 UTC (rev 9237)
+++ trunk/memcheck/tests/malloc_usable.c 2009-02-23 07:17:08 UTC (rev 9238)
@@ -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));
Modified: trunk/memcheck/tests/memalign2.c
===================================================================
--- trunk/memcheck/tests/memalign2.c 2009-02-23 06:44:51 UTC (rev 9237)
+++ trunk/memcheck/tests/memalign2.c 2009-02-23 07:17:08 UTC (rev 9238)
@@ -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 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);
Modified: trunk/none/tests/rlimit_nofile.c
===================================================================
--- trunk/none/tests/rlimit_nofile.c 2009-02-23 06:44:51 UTC (rev 9237)
+++ trunk/none/tests/rlimit_nofile.c 2009-02-23 07:17:08 UTC (rev 9238)
@@ -37,8 +37,9 @@
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)
Modified: trunk/none/tests/susphello.c
===================================================================
--- trunk/none/tests/susphello.c 2009-02-23 06:44:51 UTC (rev 9237)
+++ trunk/none/tests/susphello.c 2009-02-23 07:17:08 UTC (rev 9238)
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <dlfcn.h>
-
+#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>
Modified: trunk/perf/tinycc.c
===================================================================
--- trunk/perf/tinycc.c 2009-02-23 06:44:51 UTC (rev 9237)
+++ trunk/perf/tinycc.c 2009-02-23 07:17:08 UTC (rev 9238)
@@ -20606,7 +20606,7 @@
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);
|