Can realloc be marked as a mallloc-like function?
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sat Jul 14 16:03:00 GMT 2007
H.J. Lu wrote:
> It looks like gcc assumes a functon marked with DECL_IS_MALLOC won't
> return an address which can alias something else. But it isn't true
> for realloc. Now, the qestions are
>
> 1. Can gcc make such an assumption?
> 2. Can realloc be marked as DECL_IS_MALLOC.
>
> BTW, glibc also marks realloc with __attribute_malloc__.
There was an absurdely long thread on this topic starting at
<http://gcc.gnu.org/ml/gcc/2004-01/msg00005.html>. I didn't dig through
it to find the answer.
HTH,
- Tobi
More information about the Libc-alpha
mailing list