]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix some more 'make check' warnings, ones that appear on non-Linux
authorNicholas Nethercote <njn@valgrind.org>
Mon, 23 Feb 2009 07:17:08 +0000 (07:17 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 23 Feb 2009 07:17:08 +0000 (07:17 +0000)
platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9238

massif/tests/malloc_usable.c
memcheck/tests/malloc_usable.c
memcheck/tests/memalign2.c
none/tests/rlimit_nofile.c
none/tests/susphello.c
perf/tinycc.c

index e825e3d98bd9113f131e21c444e8cadee4d278b0..e2524160db76b5f4b436e57c765f3c6f009001e5 100644 (file)
@@ -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));
index 8055c95d2f9283f72259a7e346fd7bd955704514..7e912dd7bf23072dfc1670b8f3eb81a95d88e3ad 100644 (file)
@@ -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));
index daddb25494cfbffc3e24899a2dddbad1bb9e8b2f..473c924d514f81a707955bcdab33ce94dca88560 100644 (file)
 
 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);
index c563c5f304c33c7d6667ab84ac3c6229b0e4b9cb..2d8304e883ad53532df52fa7ac15f36b8a2201c5 100644 (file)
@@ -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)
index b0d53fdc8ed5501ffa6b2dd04f86797bba17e75a..e0e29c31df7337ccba5a101110736cc6f45065ed 100644 (file)
@@ -20,7 +20,7 @@
 #include <unistd.h>
 #include <dlfcn.h>
 
-
+#include <stdio.h>
 #include <pthread.h>
 #include <unistd.h>
 #include <string.h>
index 5bef0664f8d4e214ecb8fbe27a67d9a36789b4da..0a59cc3c88ad46ab9211d2a4cdaa4e17f159f5bf 100644 (file)
@@ -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);