This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: G++ defines _GNU_SOURCE, implies C99
Daniel Jacobowitz wrote:
>
> On Fri, Sep 13, 2002 at 06:58:16PM -0400, Phil Edwards wrote:
> > On Fri, Sep 13, 2002 at 03:37:59PM -0700, Michael Eager wrote:
> > > So, can anyone elucidate why _GNU_SOURCE is defined by G++ and
> > > not by GCC and/or why it implies _USE_ISOC99?
> >
> > C++ requires more smarts from the C library, and from the surrounding
> > environment, than most languages. With current C++ library sources and
> > current typical system headers, the only way to get that support is to
> > request extra standards-conforming behavior. Usually this is for I/O.
> >
> > For Linux, the c++ compiler defines _GNU_SOURCE. For Solaris, it defines
> > (or used to?) _XOPEN_SOURCE. For (whatever platform), it defines (whatever
> > it needs to get the system to give the mandated behavior).
> >
> > The side effects are: 1) programs with older, sloppier code suddenly
> > don't work, or work in surprising ways, and 2) users are exposed to newer
> > unrequested features, if _GNU_SOURCE (or whatever) turns on more than what
> > we were expecting, or needing.
> >
> >
> > > And why this is
> > > not a bug?
> >
> > It is a bug. Usually there is a single PR left open to remind everyone
> > of this fact; the canonical one containing the best explanation of the
> > situation.
> >
> > The "bug" (design flaw, more precisely) is that the C++ headers need some
> > rewriting to make these macros unneeded, but for all the bitching and
> > moaning over the effects of this misdesign, nobody has yet contributed
> > the time to do so.
>
> Is there such a PR for this one, or at least an archives pointer to
> what needs to be done? I no longer remember the discussion.
There is this closed bug in gnats:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2082
I don't find any other which mentions GNU_SOURCE in the title.
PR 2082 doesn't offer much of a suggestion on what the fix might look like.
--
Michael Eager eager@mvista.com 408-328-8426
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA 94085