This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: getopt.h getopt() decl broken for many targets
- From: Ian Lance Taylor <ian at airs dot com>
- To: "Aaron W. LaFramboise" <aaron98wiridge9 at aaronwl dot com>
- Cc: binutils <binutils at sources dot redhat dot com>, gcc <gcc at gcc dot gnu dot org>, Danny Smith <dannysmith at users dot sourceforge dot net>
- Date: 25 Mar 2005 14:07:22 -0500
- Subject: Re: getopt.h getopt() decl broken for many targets
- References: <4243856A.7040909@aaronwl.com>
"Aaron W. LaFramboise" <aaron98wiridge9@aaronwl.com> writes:
> This is due to this code:
>
> #if !HAVE_DECL_GETOPT
> #if defined (__GNU_LIBRARY__) || defined (HAVE_DECL_GETOPT)
> /* Many other libraries have conflicting prototypes for getopt, with
> differences in the consts, in unistd.h. To avoid compilation
> errors, only prototype getopt for the GNU C library. */
> extern int getopt (int argc, char *const *argv, const char *shortopts);
> #else
> #ifndef __cplusplus
> extern int getopt ();
> #endif /* __cplusplus */
> #endif
> #endif /* !HAVE_DECL_GETOPT */
>
> Is the situation described in this comment still true? Would it be
> possible to turn this whitelist into a blacklist?
Yes, the comment is still true enough that I don't think we should
change it. Instead, copy the gcc configure code which sets
HAVE_DECL_GETOPT to the binutils. In fact, I think Nick already did
this, although I don't know whether he checked it in yet.
Ian