Don't return a dangling pointer from wxDateTime::ParseXXX(wxCStrData).

We don't have any sufficiently long-lived pointer to return from this
overload, so don't return anything from it -- it's better to break the
compilation of the existing code rather than make it crash during run-time.

Closes #14214.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-05-13 21:37:25 +00:00
parent 2ed48ef81e
commit ae8079a210
2 changed files with 26 additions and 12 deletions

View File

@@ -285,6 +285,12 @@ Changes in behaviour which may result in compilation errors
error instead. This can be worked around by explicitly casting to const
wxChar*: wxLogError(_("error: %s"), !err.empty() ? (const wxChar*)err.c_str() : "")
- wxDateTime::ParseXXX() overloads don't return anything when called with
wxCStrData argument. If you need to test the parsing success, use a newer
overload taking wxString::const_iterator and returning bool or explicitly
select a narrow or wide char version to use by casting c_str() to either
"char*" or "wchar_t*". Or create a temporary wxString and parse it instead.
- wxCtime() and wxAsctime() return char*; this is incompatible with Unicode
build in wxWidgets 2.8 that returned wchar_t*.