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]
Other format: [Raw text]

Re: [patch] libiberty/strdup.c: Constify the argument.


 > > >   error: argument "s" doesn't match prototype
 > > 
 > > What prototype?  If there's a prototype, strdup.c shouldn't have
 > > been
 > > compiled - unless the runtime is broken?
 > 
 > Hmm.  I can't find one...  The GCC with Zack's patch would say the
 > same with or without const, so the error may be a bug in Zack's patch.

If you can't find strdup in your system headers, you still would be
conflicting with the builtin strdup prototype.  (We have strdup as a
builtin to apply various attributes to it like `malloc', `nothrow' and
`nonnull' and it has a const argument.)  That's probably where the
error message is coming from.

So I believe your const-ification patch is correct.  I can't speak for
Zack's patch.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


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