dimonomid / umm_malloc

a memory allocator for embedded systems (microcontrollers)
MIT License
59 stars 18 forks source link

pointer of type 'void *' used in subtraction #3

Open jd4ever opened 8 years ago

jd4ever commented 8 years ago

Hi Dmitry,

Is there a way to get around the following error (without suppressing warnings in the compiler)?

CC app/umm_malloc.c
app/umm_malloc.c: In function 'umm_free':
app/umm_malloc.c:799:12: error: pointer of type 'void *' used in subtraction [-Werror=pointer-arith]
    c = (ptr-(void *)(&(umm_heap[0])))/sizeof(umm_block);
            ^
app/umm_malloc.c: In function 'umm_realloc':
app/umm_malloc.c:1035:12: error: pointer of type 'void *' used in subtraction [-Werror=pointer-arith]
    c = (ptr-(void *)(&(umm_heap[0])))/sizeof(umm_block);
            ^
cc1: all warnings being treated as errors
make: *** [out/build/app/umm_malloc.o] Error 1

Thanks, John

dimonomid commented 8 years ago

Hi John,

Please use this repository instead: https://github.com/rhempel/umm_malloc , it is initiated by the original author of umm_malloc after I published my own, and I've done a bunch of improvements there.

In particular, the issue you're talking about is fixed as well.

Sorry, I should have indicated here that the repository is obsolete.