From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: dj@redhat.com (DJ Delorie) Cc: neil@daikokuya.demon.co.uk, gcc-patches@gcc.gnu.org Subject: Re: cpplib: basename () fix Date: Mon, 05 Mar 2001 15:57:00 -0000 Message-id: <200103052356.SAA14147@hiauly1.hia.nrc.ca> References: <200103052316.SAA01652@greed.delorie.com> X-SW-Source: 2001-03/msg00247.html > 2. basename() could check for unsafe or undefined parameters and > complain, else call the new basename replacement. The XPG variant has a different interface. The pathname passed is type "char *" and it may muck with the variable. The libiberty version uses "const char *". As a result, the string would have to be copied somewhere to interface the two which I don't particularly like. > 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. As I have been trying to say, there is more than just an undefined behavior. The interface and functionality are different from system to system, and in some case we can't even check what they are. I would far prefer just having a routine available that does the job. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605)