cin/cout as reference objects [Re: AIX I/O failures]
Mark Mitchell
mark@codesourcery.com
Thu Jan 25 19:00:00 GMT 2001
>>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:
Richard> You should therefore be *extremely* cautious in exporting
Richard> anything from a shared library that isn't a function or a
Richard> built-in type such as a pointer.
Thanks for the detailed analysis. That's very interesting.
What you say, though, applies to the *original* approach as well, so
we're no better off than we were then, if I understand correctly.
(Because all I did was change the *type* of an aggregate, not its
existence.)
So, you're information argues in favor of Gaby's proposal -- the
indirection protects you against changes in the sizes of the object,
from the ABI point of view.
But, that doesn't really do any good, because there are inline
functions on ostreams anyhow, and because users can say `sizeof
(cout)' in their programs, and if the library implementors change the
size of the stream, those folks are going to be hosted anyhow,
regardless of the shared object/linker thing, right?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Libstdc++
mailing list