fopen deprecated warning
On Visual Studio 2015 C++ compiler, I get the following warning when my code uses the fopen and such calls.
foo.cpp(5) : warning C4996: 'fopen' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen'
Message: 'This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
Well, you could add a:
#pragma warning (disable : 4996)
Before you are possible to use fopen but become you considered using fopen_s as the warning recommends? It returns an error code permitting you to check the result of the function call.
The problem with just disabling deprecated function warnings is that Microsoft may discard the role in question in a later version of the CRT, breaking your code. Now, this won’t happen in this instance with fopen because it’s part of the C & C++ ISO standards.