C++ Static String Causes Segmentation Fault

Ben Atkinson bwa4992@yahoo.com
Wed Jul 22 21:03:00 GMT 2009


Great!  Thanks for your reply, Jonathan.


Jonathan Wakely wrote:


----- Original Message ----

> 2009/7/22 Ben Atkinson:
> >
> > Thanks for the response, Ian.   With an eye toward correcting the problem
> > in my source code, does C++ make any guarantees about global
> > constructors in the same source?
> 
> They are constructed in the order they appear in the source, and
> destroyed in the reverse order.
> 
> > Several initial tests indicate that the following code works regardless of
> > whether main.cpp or StringTest.cpp appears first on the g++ command
> > line, but does C++ guarantee it?
> 
> Yes.



      



More information about the Libstdc++ mailing list