This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to tell compiler to use my_malloc inplace of normal 'malloc'


Hello,

why don't you compile the files you want to use my_alloc
with -Dmalloc=my_malloc and the rest without:

gcc -c file1.c file2.c -Dmalloc=my_malloc
gcc -c my_alloc.c
gcc file1.o file2.o my_alloc.o

You said, you just want to replace the malloc-*calls*, so I assume, the
string "alloc" appears otherwise, too. Perhaps -Dmalloc(=my_malloc( will
work?

But thats a really ugly solution...

Mirko Vogel




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]