public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
@ 2002-03-03 14:56 dpo
0 siblings, 0 replies; 5+ messages in thread
From: dpo @ 2002-03-03 14:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 5821
>Category: c++
>Synopsis: Solaris: C++ compiler defines _XOPEN_SOURCE
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 03 14:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: dpo@club-internet.fr
>Release: 3.0.4
>Organization:
>Environment:
Solaris 8 on various Sparc machines
>Description:
I'm sorry to open a new bug report about the same
issue, but report #4915 was erroneously closed and
I don't know how to reopen it.
I won't discuss that libstdc++ may need to define
_XOPEN_SOURCE, although I'm curious why. I'll try
to remove it and see what happens for myself.
The problem is that one should not be defining
_XOPEN_SOURCE just because it's practical, for
example for building libstdc++. This is a bad
hack.
The default Solaris environment is to have none
of the _XOPEN_SOURCE_EXTENDED, _XOPEN_SOURCE,
__EXTENSIONS__, and other similar macros defined.
The C compiler is not modifying this default
environment and the C++ compiler should not either.
Just like the Sun C/C++ compilers.
If libstdc++ needs _XOPEN_SOURCE, then its build
system should be fixed so that _XOPEN_SOURCE is
defined when libstdc++ is built.
The problem is that defining _XOPEN_SOURCE triggers
lots of macro definitions like
#define connect ...
that break sources that have always been compiling
with previous GNU compilers and Sun compilers. Well,
the sources can be modified of course. But the compiler
shouldn't modify the standard Solaris environment.
Let the user decide about it.
>How-To-Repeat:
$ gcc --version
3.0.2
$ cat foo.c
_XOPEN_SOURCE
$ gcc -E foo.c
# 1 "foo.c"
_XOPEN_SOURCE
$
$ g++ --version
3.0.2
$ cat foo.cc
_XOPEN_SOURCE
$ g++ -E foo.cc
# 1 "foo.cc"
500
$
>Fix:
Do not define _POSIX_SOURCE in the C++ compiler.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
@ 2002-03-05 13:56 Phil Edwards
0 siblings, 0 replies; 5+ messages in thread
From: Phil Edwards @ 2002-03-05 13:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/5821; it has been noted by GNATS.
From: Phil Edwards <phil@jaj.com>
To: Dimitri Papadopoulos <dpo@club-internet.fr>
Cc: rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
Date: Tue, 5 Mar 2002 16:52:00 -0500
On Mon, Mar 04, 2002 at 11:55:31PM +0100, Dimitri Papadopoulos wrote:
> > It's not "practical". It's "required". As in, if it's not defined,
> > nothing works.
>
> As I said if libstdc++ requires _XOPEN_SOURCE just
> define it when building libstdc++. But then maybe
> it's required by libstdc++ headers made available to
> end-users. In that case I do understand the problem
> better. But it still can be worked around by writing
> wrappers or modifying headers appropriately. Then
> maybe it's still something else: in that case please
> someone explain me. I have good knowledge of Solaris
> and I may help to remove the need for _XOPEN_SOURCE.
Large parts of the C++ standard library are actually defined in the header
files (until the compiler supports 'export'), so maintainer build-time
details are often also end-user compile-time details.
> Finally if your concern is 64-bit targets, then you
> need to define
> -xarch=v9 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
> as documented in the solaris documentation, but still,
> the Solaris environment leaves it to the user to define
> these variables.
This would be handled by the compiler config files for 64-bit Solaris.
> > This has been discussed to death on the mailing lists. See the archives
> > before resubmitting the same bug report.
>
> This bug report was not in the archives when this bug was
> reported.
I may have confused you with one of the other reporters. If I did,
I apologize.
> And in any case searching the archive gives:
> No matches were found for '_xopen_source and solaris'.
> Consider fixing the search engine first...
Eh? I get 72 matches for both terms, and 234 matches for _XOPEN_SOURCE
alone.
> I do understand you have limited time, and I do appreciate
> your efforts to bring out a free compiler. But maybe someone
> could have told me this was discussed in the mailing lists
> and given a short explanation (something better than "It's
> not practical. It's required." which is supposed to make
> me feel like an idiot because I don't understand what other
> oh so brilliant people understand).
>
> I've been chasing bugs in GCC for some years (few bugs maybe,
> but still) and would have expected a different tone in your
I apologize for my tone. The _XOPEN_SOURCE kludge -- and yes, it is a
kludge, we would like to replace it with something better -- keeps getting
brought up over and over by people who simply assert that it's easy to
"fix" without ever actually demonstrating how. After a while it becomes
bothersome.
I think I'll add this to the libstdc++ FAQ, and provide a link to the
mailing list archives.
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
@ 2002-03-04 14:56 Dimitri Papadopoulos
0 siblings, 0 replies; 5+ messages in thread
From: Dimitri Papadopoulos @ 2002-03-04 14:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/5821; it has been noted by GNATS.
From: Dimitri Papadopoulos <dpo@club-internet.fr>
To: rodrigc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
Phil Edwards <phil@jaj.com>
Cc:
Subject: Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
Date: Mon, 04 Mar 2002 23:55:31 +0100
Hi,
> > The problem is that one should not be defining
> > _XOPEN_SOURCE just because it's practical, for
> > example for building libstdc++. This is a bad
> > hack.
>
> It's not "practical". It's "required". As in, if it's not defined,
> nothing works.
As I said if libstdc++ requires _XOPEN_SOURCE just
define it when building libstdc++. But then maybe
it's required by libstdc++ headers made available to
end-users. In that case I do understand the problem
better. But it still can be worked around by writing
wrappers or modifying headers appropriately. Then
maybe it's still something else: in that case please
someone explain me. I have good knowledge of Solaris
and I may help to remove the need for _XOPEN_SOURCE.
Note that by default the Solaris environment defines
this macro:
__EXTENSIONS__
which is supposed to encompass more or less all these
macros:
_XPG5
_XPG4_2
_POSIX_C_SOURCE
_POSIX_C_SOURCE
so as to make the system API as wide as possible and
compliant with the latest XPG at the time Solaris is
released. There are some exceptions. They are needed
for maintaining default compatibility with previous
versions of Solaris.
By merely defining
_XOPEN_SOURCE
you restrict the API to XPG3 which I really can't
understand why ot would be needed.
Finally if your concern is 64-bit targets, then you
need to define
-xarch=v9 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
as documented in the solaris documentation, but still,
the Solaris environment leaves it to the user to define
these variables.
> This has been discussed to death on the mailing lists. See the archives
> before resubmitting the same bug report.
This bug report was not in the archives when this bug was
reported.
And in any case searching the archive gives:
No matches were found for '_xopen_source and solaris'.
Consider fixing the search engine first...
I do understand you have limited time, and I do appreciate
your efforts to bring out a free compiler. But maybe someone
could have told me this was discussed in the mailing lists
and given a short explanation (something better than "It's
not practical. It's required." which is supposed to make
me feel like an idiot because I don't understand what other
oh so brilliant people understand).
I've been chasing bugs in GCC for some years (few bugs maybe,
but still) and would have expected a different tone in your
answer.
Anyway, keep up the good job.
Regards,
Dimitri Papadopoulos
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
@ 2002-03-04 7:46 Phil Edwards
0 siblings, 0 replies; 5+ messages in thread
From: Phil Edwards @ 2002-03-04 7:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/5821; it has been noted by GNATS.
From: Phil Edwards <phil@jaj.com>
To: dpo@club-internet.fr
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
Date: Mon, 4 Mar 2002 10:45:49 -0500
> The problem is that one should not be defining
> _XOPEN_SOURCE just because it's practical, for
> example for building libstdc++. This is a bad
> hack.
It's not "practical". It's "required". As in, if it's not defined,
nothing works.
This has been discussed to death on the mailing lists. See the archives
before resubmitting the same bug report.
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE
@ 2002-03-03 15:03 rodrigc
0 siblings, 0 replies; 5+ messages in thread
From: rodrigc @ 2002-03-03 15:03 UTC (permalink / raw)
To: dpo, gcc-bugs, gcc-prs, nobody
Synopsis: Solaris: C++ compiler defines _XOPEN_SOURCE
State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Mar 3 15:03:40 2002
State-Changed-Why:
Duplicate of PR 4915.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5821
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-03-05 21:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-03 14:56 c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE dpo
2002-03-03 15:03 rodrigc
2002-03-04 7:46 Phil Edwards
2002-03-04 14:56 Dimitri Papadopoulos
2002-03-05 13:56 Phil Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).