This is the mail archive of the gcc-patches@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: Patch: malloc function attribute


 > 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


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