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: cpplib: basename () fix


DJ Delorie wrote:-

> (3) If the results of passing an empty string are undefined
> standards-wise, programs should be careful not to pass empty strings.
> Otherwise, we might as well make basename() non-optional in libiberty,
> for the day when all platforms "fix" their basename.  I hesitate to do
> this, as we'd then be promoting obsolete behavior.

I agree with have a single basename () function, possibly with a different
name, that gives the same semantics wherever you run GCC.

The current situation of relying on the libc implementation on some
targets, is poor.  I was bitten by this last week; there doesn't seem to
be a "standard" basename () with common semantics across platforms.  So
IMO the best solution is we provide one for our own use and use that
always.

If we want to stick with an optional basename (), then let's make it
a stub that just calls gcc_basename (), which contains the function
body and does the right thing (tm).

Neil.


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