[Dcmlib] [Fwd: Re: std::string and global symbols]

Mathieu Malaterre mathieu.malaterre at kitware.com
Mon Oct 17 17:56:03 CEST 2005


Hello,

	I recently added a test called 'loadmodule', it is garantee to seg 
fault on linux x86 and amd64. For the curious the full story is here:

http://groups.google.com/group/comp.lang.c++/browse_frm/thread/b745ebbfc8c24b1c/6745da372b2015ec

	So I don't see no other way than going back to a regular cstring 
approach, where you are actually garantee that optimization actually 
occur. The only drawback is that now a std::string will be constructed 
in the case where the key is not found.

	I will start working on that shortly as this is a big issue for ITK.

Comments ?
Mathieu


-------- Original Message --------
>Any comments on a better approach/solution ?

Return an object, not a reference. For global variables, there is no
guarantee about order of initialization, and therefore order of
destruction -- as you have seen -- is also not always as expected.

--
Bob Hairgrove



More information about the Dcmlib mailing list