This is the mail archive of the 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

> > It looks like the test is located with other run-this tests (eg.,
> You can test to see if a program is buildable, but you can't test how
> a program *runs*.  If I'm using my Linux box to build a Cygwin-hosted
> m68k compiler, how can I see what basename() returns in Cygwin's libc?

You obviously can't but if the test fails for ANY reason the basename
routine gets built.  This is wrong in the above case only if the Cygwin
libc version is necessary and incompatible with the libiberty version.
I think if you look at the configure script you will find that basename
gets excluded from the list of objects for various embedded hosts such as
vxworks.  The test won't run if this happens.  Thus, there is a way
to handle your Cygwin-hosted m68k compiler.

> > I highly doubt that the day will come where all platforms "fix" their
> > basename and adopt the glibc variant.
> No, I meant fix it and adopt the XPG variant, which is not what your
> patch is promoting, or what gcc was expecting.

This all started with an attempt to replace the procedure
file_name_nondirectory currently in toplev.c with "basename".  The
XPG variant is not appropriate for OSes such as VMS or DOS.  On the
otherhand, the name-within-directory variant of basename found in
glibc and libiberty isn't a bad fit.  It is also more suited to what
is needed in gcc as far as I can tell.  The XPG variant is very unix
centric in terms of the definition of pathnames, separator characters
etc.  Thus, I wouldn't promote the replacement of the libiberty
version with the XPG version.

J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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