wxWidgets problem using 3.0.x & VS2013

594 views
Skip to first unread message

DK

unread,
Oct 7, 2014, 2:39:09 PM10/7/14
to wx-...@googlegroups.com
I would be grateful for some help.

We have an Open Source project that compiles without warnings using
wxWidgets 2.8.12. However, on moving to 3.0.1 (or 3.0.2), one source
member (and only one source member) produces 51 warning message C4996 as
below. No other source member produces any errors or warnings on moving
from 2.8.12 to 3.0.1.

We have set the pre-processor variables:
"_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1" and
"_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1", which should use the
"Secure Template Overloads" to automatically change to use the secure
versions, as per
http://msdn.microsoft.com/en-us/library/ms175759%28v=vs.120%29.aspx, as I
think happens with wxWidgets 2.8.12.

The C4996 warning messages suggest to use _CRT_SECURE_NO_WARNINGS to
suppress these messages but we want to use the secure versions and need the
warnings to ensure that we do.

This one source member is very simple - a cutdown copy of the example for
copying and retrieving data from the clipboard
(http://docs.wxwidgets.org/trunk/classwx_clipboard.html).

The issue is caused just by including the STL header file <string> (or any
header
file that includes it) before "<wx/clipbrd.h>" & "<wx/dataobj.h>" and, as we
wish
to use std::wstring variables as member variables and as parameters in any
future functions, then it must be included in the Header file (Test.h below)
and
we normally place that at the top of the source file (Text.cpp below).

It appears to be the order of "#include <string>" vs "#include
<wx/clipbrd.h>" & "#include <wx/dataobj.h>".

Thank you.

Our source member:

#include "Test.h"

#include <wx/clipbrd.h>
#include <wx/dataobj.h>

#ifdef __WXMSW__
#include <wx/msw/msvcrt.h>
#endif /* __WXMSW__ */

bool TestClipboard::ClearData()
{
// TBD
return false;
}

Our header "Test.h":

#ifndef _Test_H_
#define _Test_H_

#include <string>

namespace TestClipboard {
// Future member variables/functions using std::wstring
bool ClearData();
}

#endif /* _Test_H_ */

Warning messages:

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(209): warning C4996: 'strcpy':
This function or variable may be unsafe. Consider using strcpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(112) : see declaration of 'strcpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(211): warning C4996: 'wcscpy':
This function or variable may be unsafe. Consider using wcscpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(294) : see declaration of 'wcscpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(213): warning C4996: 'strcpy':
This function or variable may be unsafe. Consider using strcpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(112) : see declaration of 'strcpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(215): warning C4996: 'strcpy':
This function or variable may be unsafe. Consider using strcpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(112) : see declaration of 'strcpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(217): warning C4996: 'strcpy':
This function or variable may be unsafe. Consider using strcpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(112) : see declaration of 'strcpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(219): warning C4996: 'wcscpy':
This function or variable may be unsafe. Consider using wcscpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(294) : see declaration of 'wcscpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(221): warning C4996: 'wcscpy':
This function or variable may be unsafe. Consider using wcscpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(294) : see declaration of 'wcscpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(223): warning C4996: 'wcscpy':
This function or variable may be unsafe. Consider using wcscpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(294) : see declaration of 'wcscpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(225): warning C4996: 'strcpy':
This function or variable may be unsafe. Consider using strcpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(112) : see declaration of 'strcpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(227): warning C4996: 'wcscpy':
This function or variable may be unsafe. Consider using wcscpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(294) : see declaration of 'wcscpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(230): warning C4996: 'strncpy':
This function or variable may be unsafe. Consider using strncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(195) : see declaration of 'strncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(232): warning C4996: 'wcsncpy':
This function or variable may be unsafe. Consider using wcsncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(323) : see declaration of 'wcsncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(234): warning C4996: 'strncpy':
This function or variable may be unsafe. Consider using strncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(195) : see declaration of 'strncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(236): warning C4996: 'strncpy':
This function or variable may be unsafe. Consider using strncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(195) : see declaration of 'strncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(238): warning C4996: 'strncpy':
This function or variable may be unsafe. Consider using strncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(195) : see declaration of 'strncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(240): warning C4996: 'wcsncpy':
This function or variable may be unsafe. Consider using wcsncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(323) : see declaration of 'wcsncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(242): warning C4996: 'wcsncpy':
This function or variable may be unsafe. Consider using wcsncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(323) : see declaration of 'wcsncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(244): warning C4996: 'wcsncpy':
This function or variable may be unsafe. Consider using wcsncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(323) : see declaration of 'wcsncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(246): warning C4996: 'strncpy':
This function or variable may be unsafe. Consider using strncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(195) : see declaration of 'strncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(248): warning C4996: 'wcsncpy':
This function or variable may be unsafe. Consider using wcsncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(323) : see declaration of 'wcsncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(260): warning C4996: 'strncpy':
This function or variable may be unsafe. Consider using strncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(195) : see declaration of 'strncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(273): warning C4996: 'wcsncpy':
This function or variable may be unsafe. Consider using wcsncpy_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(323) : see declaration of 'wcsncpy'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(281): warning C4996: 'strcat':
This function or variable may be unsafe. Consider using strcat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(118) : see declaration of 'strcat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(283): warning C4996: 'wcscat':
This function or variable may be unsafe. Consider using wcscat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(284) : see declaration of 'wcscat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(285): warning C4996: 'strcat':
This function or variable may be unsafe. Consider using strcat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(118) : see declaration of 'strcat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(287): warning C4996: 'strcat':
This function or variable may be unsafe. Consider using strcat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(118) : see declaration of 'strcat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(289): warning C4996: 'strcat':
This function or variable may be unsafe. Consider using strcat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(118) : see declaration of 'strcat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(291): warning C4996: 'wcscat':
This function or variable may be unsafe. Consider using wcscat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(284) : see declaration of 'wcscat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(293): warning C4996: 'wcscat':
This function or variable may be unsafe. Consider using wcscat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(284) : see declaration of 'wcscat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(295): warning C4996: 'wcscat':
This function or variable may be unsafe. Consider using wcscat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(284) : see declaration of 'wcscat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(297): warning C4996: 'strcat':
This function or variable may be unsafe. Consider using strcat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(118) : see declaration of 'strcat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(299): warning C4996: 'wcscat':
This function or variable may be unsafe. Consider using wcscat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(284) : see declaration of 'wcscat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(302): warning C4996: 'strncat':
This function or variable may be unsafe. Consider using strncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(186) : see declaration of 'strncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(304): warning C4996: 'wcsncat':
This function or variable may be unsafe. Consider using wcsncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(316) : see declaration of 'wcsncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(306): warning C4996: 'strncat':
This function or variable may be unsafe. Consider using strncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(186) : see declaration of 'strncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(308): warning C4996: 'strncat':
This function or variable may be unsafe. Consider using strncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(186) : see declaration of 'strncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(310): warning C4996: 'strncat':
This function or variable may be unsafe. Consider using strncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(186) : see declaration of 'strncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(312): warning C4996: 'wcsncat':
This function or variable may be unsafe. Consider using wcsncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(316) : see declaration of 'wcsncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(314): warning C4996: 'wcsncat':
This function or variable may be unsafe. Consider using wcsncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(316) : see declaration of 'wcsncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(316): warning C4996: 'wcsncat':
This function or variable may be unsafe. Consider using wcsncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(316) : see declaration of 'wcsncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(318): warning C4996: 'strncat':
This function or variable may be unsafe. Consider using strncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(186) : see declaration of 'strncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(320): warning C4996: 'wcsncat':
This function or variable may be unsafe. Consider using wcsncat_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\string.h(316) : see declaration of 'wcsncat'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(754): warning C4996: '_wfopen':
This function or variable may be unsafe. Consider using _wfopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\stdio.h(590) : see declaration of '_wfopen'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(756): warning C4996:
'_wfreopen': This function or variable may be unsafe. Consider using
_wfreopen_s instead. To disable deprecation, use
_CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files
(x86)\Microsoft Visual Studio 12.0\VC\include\stdio.h(592) : see
declaration of '_wfreopen'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(923): warning C4996: 'getenv':
This function or variable may be unsafe. Consider using _dupenv_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\stdlib.h(462) : see declaration of 'getenv'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(924): warning C4996:
'_wgetenv': This function or variable may be unsafe. Consider using
_wdupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
See online help for details.
C:\Program Files (x86)\Microsoft Visual
Studio 12.0\VC\include\stdlib.h(711) : see declaration of '_wgetenv'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(925): warning C4996: 'getenv':
This function or variable may be unsafe. Consider using _dupenv_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\stdlib.h(462) : see declaration of 'getenv'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(926): warning C4996: 'getenv':
This function or variable may be unsafe. Consider using _dupenv_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\stdlib.h(462) : see declaration of 'getenv'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(927): warning C4996: 'getenv':
This function or variable may be unsafe. Consider using _dupenv_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\stdlib.h(462) : see declaration of 'getenv'

..\VC\wxWidgets\3.0.1\include\wx/wxcrt.h(928): warning C4996:
'_wgetenv': This function or variable may be unsafe. Consider using
_wdupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
See online help for details.
C:\Program Files (x86)\Microsoft Visual
Studio 12.0\VC\include\stdlib.h(711) : see declaration of '_wgetenv'

..\VC\wxWidgets\3.0.1\include\wx/filefn.h(515): warning C4996: '_wopen':
This function or variable may be unsafe. Consider using _wsopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\wchar.h(368) : see declaration of '_wopen'


Vadim Zeitlin

unread,
Oct 7, 2014, 2:55:01 PM10/7/14
to wx-...@googlegroups.com
On Tue, 7 Oct 2014 19:25:54 +0100 DK wrote:

D> It appears to be the order of "#include <string>" vs "#include
D> <wx/clipbrd.h>" & "#include <wx/dataobj.h>".

Well, yes, it is, so it seems like you already have an answer, what else
would you like to know? Explanation of why this is so is quite simple:
wx/defs.h, which is the first wx header included by anything else, defines
_CRT_SECURE_NO_DEPRECATE, which results in _CRT_SECURE_NO_WARNINGS getting
defined by the CRT headers and so no warnings are given. So if wx/whatever.h
is included before <string>, the warnings are suppressed, otherwise they
are given.

Notice that currently you can't prevent wx/defs.h from defining
_CRT_SECURE_NO_DEPRECATE as we hadn't realized there would people who
wanted to leave these warnings on, so you can't really use
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES with wx. Notice that no amount of
overloading can make functions like wxStrcpy() safe, so without
_CRT_SECURE_NO_DEPRECATE you would still be getting warnings for every
source file including wx/string.h.

Regards,
VZ

DK

unread,
Oct 7, 2014, 3:14:56 PM10/7/14
to wx-...@googlegroups.com
I understand what you are saying but this has changed from 2.8.12. Our
source code didn't change between compiling with 2.8.12 and 3.0.x.

2.8.12 wx/defs.h also defined _CRT_SECURE_NO_DEPRECATE but we did not get
any warnings. We didn't set _CRT_SECURE_NO_WARNINGS but you mention that it
was defined by the CRT headers - so has this changed too?

I had assumed, therefore, that in 2.8.12, the overloads
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES &
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT were doing their job. Was
that not the case?

You also say "that no amount of overloading can make functions like
wxStrcpy() safe", so are you intending to make a wxStrcpy_s() function (and
similar) in a soon to be provided future release?

Regards,

DK

Vadim Zeitlin

unread,
Oct 7, 2014, 4:53:29 PM10/7/14
to wx-...@googlegroups.com
On Tue, 7 Oct 2014 20:14:51 +0100 DK wrote:

D> I understand what you are saying but this has changed from 2.8.12.

This is quite possible, wx/wxcrt.h didn't even exist in 2.8.

D> 2.8.12 wx/defs.h also defined _CRT_SECURE_NO_DEPRECATE but we did not get
D> any warnings. We didn't set _CRT_SECURE_NO_WARNINGS but you mention that it
D> was defined by the CRT headers - so has this changed too?

_CRT_SECURE_NO_WARNINGS is set by MSVC CRT headers if
_CRT_SECURE_NO_DEPRECATE is set, it's just a new name for the same thing.

D> I had assumed, therefore, that in 2.8.12, the overloads
D> _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES &
D> _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT were doing their job. Was
D> that not the case?

I don't know for sure, but this certainly seems likely.

D> You also say "that no amount of overloading can make functions like
D> wxStrcpy() safe", so are you intending to make a wxStrcpy_s() function (and
D> similar) in a soon to be provided future release?

No, I'm pretty sure we're not going to do this, we don't want people to
have to define WX_SECURE_NO_DEPRECATE in addition to
_CRT_SECURE_NO_DEPRECATE if they really want to use it. The only thing we
could do would be to deprecate wxStrcpy() in the usual way, i.e. by using
wxDEPRECATED, but so far there are no plans to do it.

Regards,
VZ
Reply all
Reply to author
Forward
0 new messages