stonier / ecl_core

A set of tools and interfaces extending the capabilities of c++ to provide a lightweight, consistent interface with a focus for control programming.
Other
84 stars 68 forks source link

Returning local variable from what() member of StandardException and DataException #15

Closed yichoe closed 4 years ago

yichoe commented 11 years ago

what() members of StandardException and DataException return pointer to string which is created locally. Therefore we can't expect what we'll get from calling.

It need to make what() return basic_string instance as it is or make its instance static.

stonier commented 11 years ago

Ah, this might explain the problem I had with it for a long time. On windows it sometimes shows the what(), other times it showed nothing.

Where in the code are you looking at?

yichoe commented 11 years ago

Maybe I forgot :-) I'm looking at ecl_core/ecl_exceptions in win_porting branch.