www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - writeln & cie. not reliable on Mac OS X

reply Michel Fortin <michel.fortin michelf.com> writes:
I have an annoying problem where writing to the output stream with 
writeln and other similar functions crash with an null dereference, but 
it appear to depend on the order the modules are compiled or linked. I 
wasn't able to reduce it to a

I've found a workaround. I can add this at the beginning of main():

	std_stdio_static_this();

which forces the initialization of the standard streams and everything 
goes well.

Basically, it looks like the std_

-- 
Michel Fortin
michel.fortin michelf.com
http://michelf.com/
Dec 21 2009
parent Michel Fortin <michel.fortin michelf.com> writes:
On 2009-12-21 14:34:39 -0500, Michel Fortin <michel.fortin michelf.com> said:

 I have an annoying problem where writing to the output stream with 
 writeln and other similar functions crash with an null dereference, but 
 it appear to depend on the order the modules are compiled or linked. I 
 wasn't able to reduce it to a
 
 I've found a workaround. I can add this at the beginning of main():
 
 	std_stdio_static_this();
 
 which forces the initialization of the standard streams and everything 
 goes well.
 
 Basically, it looks like the std_

Oops, I didn't meant to send that message, not in that state. Please excuse the unterminated sentences. There's definitely a problem that occurs at some times and not others, but I can't nail the exact conditions right now. The workaround works though. -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Dec 21 2009