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: [rfa] const char *lbasename(const char *);


> so that the function doesn't silently cast a ``const char *'' into a 
>> writeable ``char *''.
> 
> 
> This change is wrong in my opinion.  The situation is very similar to that
> for strchr() and strstr().


My understanding of the intention of lbasename() was to provide robust 
basename() like semantics while avoiding all the sillyness that POSIX 
basename() had to include to ensure compatibilty with the 101 
implementations already in the field.

If you look though the archives you'll notice I posted a grype about the 
old basename() function signature ~year ago.  lbasename() is definitly a 
step (er leap) in the right direction.


>> A quick check of GCC indicates that this change will cause additional 
>> warnings in the GCC sources.  What should I do about these?  Can I also 
>> just check in the tweeks that fix these.
> 
> 
> In a follow up message, the uses in gcc/cp were missed.  Some of these
> involve writeable "strings" if I remember correctly.


Would you remember the details?  The only potential problem I noticed 
was with cp/repo.c:get_base_filename() and I think that should be 
returning a const char *.

enjoy,
	Andrew






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