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: ac131313 at cygnus dot com
- Subject: Re: RFA: include/*.h {Free,Net}BSD have correct prototypes for getopt() and basename().
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 8 Dec 1999 18:15:04 -0500 (EST)
- Cc: egcs-patches at egcs dot cygnus dot com, espie at quatramaran dot ens dot fr, law at cygnus dot com
> From: Andrew Cagney <ac131313@cygnus.com>
>
> "Kaveh R. Ghazi" wrote:
> >
> > [...discussion about basename/getopt decl for libiberty...]
> >
> > Er, sorry if this was already discussed, but why exactly are we
> > wrestling with this instead of using AC_NEED_DECLARATION(basename) ?
> >
> > We could easily copy this macro from gcc/aclocal/m4 into the libiberty
> > directory. And then we could take advantage of it to handle other
> > function decls too. (E.g. strsignal.)
>
> (Thanks for the pointer to GCC_NEED_DECLARATION, I'll use something like
> that in GDB).
Great. I think something like it will be bundled in a future version
of autoconf.
> Any way, the question isn't so much about how to detect the need
> for the basename declaration but rather what signature to use when
> one is needed.
I disagree, once we determine that the system doesn't provide one, we
simply issue the libiberty declaration. It cannot conflict with
another declaration because there is nothing to conflict with.
I think the signature differences are really only const-ness. So even
if the system has e.g. basename, but not a decl, emiting the libiberty
style decl won't be a problem.
> At present libiberty provides ``char *basename (const char*)''
> but given both liberty's implementation and the formal specification of
> that function, the current signature is clearly wrong.
Again, if we determine a particular system doesn't provide a decl,
then IMHO there is no harm with issuing the libiberty one.
(What is the "formal" basename behavior again?)
> If I submit a patch to ``fix it'' I know I'm going to cop flack. (The
> question I'm wrestling with is how much flack am I willing to incure :-)
> enjoy,
> Andrew
I'm not sure why you feel you'll get "flack" for submitting a patch.
If you like, I'll do it.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions