V3 static data in classes vs AIX

David Edelsohn dje@watson.ibm.com
Mon Jun 4 13:14:00 GMT 2001


	IBM xlC 3.6.6.0 actually produces a common symbol as well (for
class T instead of typename T).  Your latest example does have a
definition, not a reference:

     template <typename T> int S<T>::i;

	This latest commentary really doesn't make sense to me.  Why is
the compiler wrong and the library header right?  It seems that you are
trying to replicate incorrect semantics that are being generated on
systems with WEAK symbol support.

	Why are the multiple definitions correct?  Yes, you can fake out
the compiler, but why is it correct for the compiler to *NOT* create
storage for a definition?  Why should these multiple storage definitions
be merged?

	Do weak symbols specifically allow this type of use?  Or is this
specific to late binding?  I still do not understand the differences
between the semantics of COMMON and WEAK very well.

	AIX does have System V-style "runtime linking", so maybe that
would provide the correct semantics.

David



More information about the Libstdc++ mailing list