Fix some more 'make check' warnings, ones that appear on non-Linux

platforms.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9238
This commit is contained in:
Nicholas Nethercote 2009-02-23 07:17:08 +00:00
parent 2ae89cee5d
commit 94ed569cdc
6 changed files with 12 additions and 11 deletions

View 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));

View 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));

View File

@ -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);

View 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)

View File

@ -20,7 +20,7 @@
#include <unistd.h>
#include <dlfcn.h>
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>

View 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);