VAX PATCH: remove FILE_NAME_NONDIRECTORY
John David Anglin
dave@hiauly1.hia.nrc.ca
Thu Feb 22 11:45:00 GMT 2001
> It looks like you've cut and pasted the code. Why not just call it?
> Or, if it's doing something a little wrong for VAX, please change
> basename () so all its users can benefit.
While it might be nice to have a version of basename for VMS, I took this
approach for several reasons:
1) I would have to modify basename to add the VMS code and probably
change configure for libiberty. I am not in the position to test
this.
2) Since not all systems have basename and configure for gcc doesn't
check for this at the moment, configure.in would have to be patched
to search for basename (it currently checks whether the system
declares it). The header system.h would also have to be patched
to provide the appropriate declarations when the system doesn't.
3) It fairly clear that the file_name_nondirectory function exists
because it was decided in the past not to use basename from the
host system. I don't know why. Possibly, this is simply because
some systems don't have it but it might be that it is broken on
some systems.
Thus, given the small amount of code in the libiberty version of
basename, it seemed easier and less risky to just to copy the code.
Note that the code in libiberty typically only builds if the procedure
is not available on the host system. Finally, the current patch
allows a port to define FILE_NAME_NONDIRECTORY if it needs some
special handling, possibly different from that of basename.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
More information about the Gcc-patches
mailing list