This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: basename () fix
- To: dave at hiauly1 dot hia dot nrc dot ca
- Subject: Re: cpplib: basename () fix
- From: DJ Delorie <dj at redhat dot com>
- Date: Mon, 5 Mar 2001 18:16:02 -0500
- CC: neil at daikokuya dot demon dot co dot uk, gcc-patches at gcc dot gnu dot org
- References: <200103052307.SAA14023@hiauly1.hia.nrc.ca>
> Name: nwd_basename?
nwd?
> What about software that used to use basename from libiberty?
Well, we have a couple of options:
1. basename() could be the name of the "new" function we always use.
We'd have to always build and include basename in libiberty then.
2. basename() could check for unsafe or undefined parameters and
complain, else call the new basename replacement.
3. Leave basename() alone (or upgrade it to XPG) and just add a new
basename replacement.
If #1 didn't have the potential problems of conflicting prototypes,
I'd say that was my favorite. Otherwise, #2 is my favorite, but
that's just me ;-)
The easiest way to go, however, is to fix the few places that expect
the undefined basename() behavior, as has already happened for the one
gcc case.