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: RFA: include/*.h {Free,Net}BSD have correct prototypes for getopt() and basename().


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


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