Fix format string warnings
C90 doesn't support z modifier in printf's, so cast values to (unsigned long) which should be the same size as size_t on both ILP32 and LP64.
This commit is contained in:
parent
2f05d8dd32
commit
238e3ffb34
14
src/heap.c
14
src/heap.c
@ -38,8 +38,8 @@ void *debugging_calloc (size_t nmemb, size_t size, const char *file,
|
||||
assert (size > 0);
|
||||
|
||||
ptr = calloc (nmemb, size);
|
||||
fprintf (stderr, "{calloc: %p:%zu x %zu} %s:%lu\n", ptr, nmemb, size,
|
||||
file, line);
|
||||
fprintf (stderr, "{calloc: %p:%lu x %lu} %s:%lu\n", ptr,
|
||||
(unsigned long) nmemb, (unsigned long) size, file, line);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@ -50,7 +50,8 @@ void *debugging_malloc (size_t size, const char *file, unsigned long line)
|
||||
assert (size > 0);
|
||||
|
||||
ptr = malloc (size);
|
||||
fprintf (stderr, "{malloc: %p:%zu} %s:%lu\n", ptr, size, file, line);
|
||||
fprintf (stderr, "{malloc: %p:%lu} %s:%lu\n", ptr,
|
||||
(unsigned long) size, file, line);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@ -62,8 +63,8 @@ void *debugging_realloc (void *ptr, size_t size, const char *file,
|
||||
assert (size > 0);
|
||||
|
||||
newptr = realloc (ptr, size);
|
||||
fprintf (stderr, "{realloc: %p -> %p:%zu} %s:%lu\n", ptr, newptr, size,
|
||||
file, line);
|
||||
fprintf (stderr, "{realloc: %p -> %p:%lu} %s:%lu\n", ptr, newptr,
|
||||
(unsigned long) size, file, line);
|
||||
return newptr;
|
||||
}
|
||||
|
||||
@ -89,7 +90,8 @@ char *debugging_strdup (const char *s, const char *file, unsigned long line)
|
||||
return NULL;
|
||||
memcpy (ptr, s, len);
|
||||
|
||||
fprintf (stderr, "{strdup: %p:%zu} %s:%lu\n", ptr, len, file, line);
|
||||
fprintf (stderr, "{strdup: %p:%lu} %s:%lu\n", ptr,
|
||||
(unsigned long) len, file, line);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user