This is the mail archive of the
mailing list for the GCC project.
Re: VAX PATCH: remove FILE_NAME_NONDIRECTORY
- To: neil at daikokuya dot demon dot co dot uk (Neil Booth)
- Subject: Re: VAX PATCH: remove FILE_NAME_NONDIRECTORY
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Thu, 22 Feb 2001 14:44:57 -0500 (EST)
- Cc: gcc-patches at gcc dot gnu dot org
> 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
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
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.
J. David Anglin firstname.lastname@example.org
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)