This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: malloc function attribute
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: Patch: malloc function attribute
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 30 Nov 1999 00:08:35 -0700
- cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, green at cygnus dot com, gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <19991129194725.B1961@cygnus.com>you write:
> On Mon, Nov 29, 1999 at 01:35:14AM -0500, Kaveh R. Ghazi wrote:
> > QUESTION: should realloc and similar functions which could possibly
> > return the same pointer more than once have this attribute?
>
> No. The attribute means "the function returns new unaliased storage".
Why do you think realloc doesn't do that? Is it the example Mark posted?
If so and we decide that's a reasonable thing for realloc to do, then we need
to remove realloc from the list of malloc-like functions.
jeff