This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to tell compiler to use my_malloc inplace of normal 'malloc'
- To: <gcc-help at gcc dot gnu dot org>
- Subject: Re: How to tell compiler to use my_malloc inplace of normal 'malloc'
- From: "Mirko Vogel" <mirko dot vogel at gmx dot de>
- Date: Thu, 23 Aug 2001 11:03:28 -0400
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