This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: AIX, Solaris 2.8 excess errors fails




--On Wednesday, February 20, 2002 06:23:41 PM +0000 Jason Merrill 
<jason@redhat.com> wrote:

>>>>>> "David" == David Edelsohn <dje@watson.ibm.com> writes:
>
>> 	The patch fixes some of the failures, but I am not sure that I
>> agree with explicitly instantiating the static fields in the testcases
>> because that is not what most user programs do, so it just covers up the
>> problem.  I would prefer that you revert that part of the patch.
>
> I disagree; this is a known limitation, not a failure.  These are tests
> for library functionality, so workarounds are fine.
>
> It is what user programs need to do if they want to work on AIX...

I agree.  At present, with G++ users must perform explicit instantiations
on AIX.

To claim that the problem is with libstdc++ is being a little too
generous -- the problem is that the compilation system is broken on
AIX.  A feature that is supposed to work in the language (namely,
implicit instantiation of templates) does not work.  Programs that
depend on that -- but make no use of the standard library -- would
have exactly the same problem.  The fixes are template repositories,
OS weak symbol support, link-time instantiation, etc., etc.

Now, it's *also* true that the library has not always done a good job
of minimizing the damage on systems with weak symbols.  I believe the
policy is that commonly used static data members should be explicitly
instantiated in the library so as to minimize the pain.
But, static data members for uncommonly used types should not be
explicit instantiated -- there's no way to enumerate all possible template
parameter types and there's no reason to fill up the library with gunk
that is almost never used.  In those cases, given the brokenness of the
compilation system, the users is just going to have to do explicit
instantiation.

So, the library tests should contain explicit instantiations precisely
for those things that qualify as uncommonly used.  That is, things
like basic_string<long>.  Things like basic_string<char> should be
explicitly instantiated in the library.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


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