[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] quell compiler warning in malloc.c
From: |
Theodore A. Roth |
Subject: |
[avr-libc-dev] quell compiler warning in malloc.c |
Date: |
Tue, 27 Aug 2002 13:53:41 -0700 (PDT) |
Hi,
Does this look like safe way to stop this compiler warning? (see patch
below)
../../../../libc/stdlib/malloc.c:197: warning: assignment makes pointer
from integer without a cast
Joerg, I think you wrote this...
I'm also getting these, but they don't look as trivial to fix:
../../../libc/stdlib/qsort.c:143: warning: comparison between signed and
unsigned
../../../libc/stdlib/qsort.c:143: warning: signed and unsigned type in
conditional expression
../../../libc/stdlib/qsort.c:145: warning: comparison between signed and
unsigned
../../../libc/stdlib/qsort.c:147: warning: comparison between signed and
unsigned
../../../libc/stdlib/strtol.c:123: warning: comparison between signed and
unsigned
../../../libc/stdlib/strtol.c:123: warning: comparison between signed and
unsigned
../../../libc/stdlib/strtoul.c:100: warning: comparison between signed and
unsigned
../../../libc/stdlib/strtoul.c:100: warning: comparison between signed and
unsigned
Ted Roth
diff -u -r1.1 malloc.c
--- libc/stdlib/malloc.c 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/stdlib/malloc.c 27 Aug 2002 20:45:37 -0000
@@ -194,7 +194,7 @@
brkval = __malloc_heap_start;
cp = __malloc_heap_end;
if (cp == 0)
- cp = STACK_POINTER() - __malloc_margin;
+ cp = (char *)(STACK_POINTER() - __malloc_margin);
if (brkval + len + sizeof(size_t) < cp) {
fp1 = (struct freelist *)brkval;
brkval += len + sizeof(size_t);
- [avr-libc-dev] quell compiler warning in malloc.c,
Theodore A. Roth <=