This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: malloc function attribute
- To: nathan at cs dot bris dot ac dot uk
- Subject: Re: Patch: malloc function attribute
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 1 Dec 1999 09:39:49 -0500 (EST)
- Cc: egcs-patches at egcs dot cygnus dot com, law at cygnus dot com
> From: Nathan Sidwell <nathan@acm.org>
>
> "Kaveh R. Ghazi" wrote:
>
> > 1999-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
> >
> > + * calls.c (special_function_p): Remove `realloc' and add `strdup'
> > + to the list of functions which have attribute malloc by default.
> > +
> Why strdup? Surely that's
>
> char *dst = malloc (strlen (src) + 1);
> if (dst) strcpy (dst, src);
> return dst;
>
> nathan
I don't understand your question. I added strdup, your example
supports that action. (Maybe you misread the ChangeLog entry and
thought I removed strdup?)
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions