This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [rfa] const char *lbasename(const char *);
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: [rfa] const char *lbasename(const char *);
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 02 Jul 2001 13:10:15 -0400
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200106300701.DAA23068@hiauly1.hia.nrc.ca>
> 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