Mail Archives: djgpp-workers/1999/05/08/17:04:46
When compiling malloc.c with -W, gcc reports warnings for
comparisons between unsigned and signed in several places. This
occurs because malloc and realloc take a size_t while BLOCK uses an
int. The fix is trivial but hardly critical:
*** src/libc/ansi/stdlib/malloc.c.orig Mon Apr 19 23:33:08 1999
--- src/libc/ansi/stdlib/malloc.c Sat May 8 16:50:50 1999
***************
*** 6,12 ****
#include <unistd.h>
typedef struct BLOCK {
! int size;
struct BLOCK *next;
int bucket;
} BLOCK;
--- 6,12 ----
#include <unistd.h>
typedef struct BLOCK {
! size_t size;
struct BLOCK *next;
int bucket;
} BLOCK;
*************** realloc(void *ptr, size_t size)
*** 329,335 ****
{
BLOCK *b;
char *newptr;
! int copysize;
if (ptr == 0)
return malloc(size);
--- 329,335 ----
{
BLOCK *b;
char *newptr;
! size_t copysize;
if (ptr == 0)
return malloc(size);
---
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -