This is the mail archive of the gcc@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: getopt.h vs java lossage


Jeffrey A Law <law@cygnus.com> writes:

> Ugh.  I see that GNU getopt.h actually wants to export the no_argument
> and other definitions which is a pretty clear name space violation
> (unless someone can point to ISO or ANSI specs which allow getopt.h
> to provide no_argument, required_argument and optional_argument as
> #defines (or via any other mechanism).

You are correct, these are violations.  I haven't changed it because
it breaks the interface.

> In the interest of avoiding such a visible spec change in the egcs
> getopt.h, I'll relent and fix java to avoid using those names.
> 
> But long term someone needs to fix gnu getopt and all the code
> that depends on those bogus #defines.

The change will be to protect the definitions of struct option, the
*_argument macros, and the extra prototypes using

	#ifdef _GNU_SOURCE


If every program which relies on the extensions uses as suggested
-D_GNU_SOURCE there should not be any problem.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


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