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: gcc-patches at gcc dot gnu dot org
- Subject: Re: [rfa] const char *lbasename(const char *);
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Sat, 30 Jun 2001 03:01:37 -0400 (EDT)
- Cc: ac131313 at cygnus dot com
> The current lbasename() implementation loosely translates into:
> char *
> lbasename (const char *name)
> return (char *) name;
> the attatched patch changes this to:
> const char *
> lbasename (const char *name)
> return name;
> 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().
> 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.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)