This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: c++/5821: Solaris: C++ compiler defines _XOPEN_SOURCE


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


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