This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: include/*.h {Free,Net}BSD have correct prototypes for getopt() and basename().
- To: Marc Espie <espie at quatramaran dot ens dot fr>
- Subject: Re: RFA: include/*.h {Free,Net}BSD have correct prototypes for getopt() and basename().
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 07 Dec 1999 13:33:42 +1100
- CC: egcs-patches at egcs dot cygnus dot com
- Organization: Cygnus Solutions
- References: <28976.943952540@upchuck> <199912070146.CAA22185@quatramaran.ens.fr>
Marc Espie wrote:
>
> In article <384501DC.EDF4E6DB@cygnus.com> you write:
>
> >OpenBSD:
>
> >Has libgen.h but with the include/libiberty.h signature:
> > char *basename (const char *);
>
> >So again. Hmm.
>
> >My only thought is to not declare basename() when Net/Open BSD and
> >instead point the user at <libgen.h>.
>
By ``point the user at <libgen.h>'' I was expecting the the coder to
respond by:
o adding a check for <libgen.h> to autoconf
o Add #include <libgen.h> to the .c file
but wrap it in #ifdef HAVE_LIBGEN_H.
I guess the pointer should make that clear.
> Please don't.
>
> OpenBSD is *open*, specifically, copies of our anonymous repository
> are accessible to everyone.
>
> The change of prototype of basename is very recent. In fact, I'm
> responsible for it...
Yes, I noticed it had an interesting history.
> so including <libgen.h> will hose *all* builds on OpenBSD, except those
> made with 2.6 and later.
>
> OpenBSD 2.6 was officially released less than a week ago.
Yes. But they are hosed if the do and hosed if they don't. That is why
I was suggesting libiberty not try to provide a prototype for basename()
when the local system in all likelyhood already defines one.
As an opinion, I think libiberty's basename() should be replaced with
xbasename() (or similar). That way everyone can use a 'basename() with
the semantics / signature that they want :-). I think it is very
dangerous to try to imply that the official basename function has
semantics other than what that committee decided.
enjoy,
Andrew