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 *);


> 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)


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