AIX I/O failures

Gabriel Dos Reis gdr@codesourcery.com
Thu Jan 25 12:59:00 GMT 2001


Phil Edwards <pedwards@disaster.jaj.com> writes:

[...]

| > Can a conforming program detect the followiing declaration for cin:
| > 
| > 	extern istream& cin;	// can a conforming program detect?
| > 
| > so that we can do
| > 
| > 	char __cin_storage[sizeof(istream)]
| > 	     __attribute__ ((__align (__alignof__ (istream))));
| > 
| > 
| > 	istream& cin = *(istream*)(&__cin_storage[0]);
| > 
| > Or is that still sufering from the init issue?
| 
| I just tested this; it works on linux.  I won't be able to test on solaris
| unti later today or tomorrow.  (I don't have an AIX box, of course.)
| 
| Changing the type of cin to a reference seems to be not too dangerous.
| Got to love that as-if rule.  :-)

:-) I also don't believe a conforming program could detect it -- cin
isn't copyable anyway. And the lvalue 'std::cin' in effect acts like a
reference.

It would be kind to hear from those who have access to AIX boxes to
test the above workaround.

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com


More information about the Libstdc++ mailing list