I am new in programming in C and I'm not used to work in Visual Studio 2015, my professor sent me a source code for a homework, but I'm obtaining the following error:
Error C4996 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
I already looked in the forums of Visual Studio. Nonetheless, I didn't understand how to disable this warning in order to be able to compile the application.
Suppress specific warnings for Visual C# or F# Or, select the project node and press Alt+Enter. Choose Build, and go to the Errors and warnings subsection. In the Suppress warnings or Suppress specific warnings box, specify the error codes of the warnings that you want to suppress, separated by semicolons.
Use a #pragma warning (C#) or Disable (Visual Basic) directive to suppress the warning for only a specific line of code.
Right-click the project in Solution Explorer and then click Properties. Choose the Code Analysis tab. Select the Suppress results from generated code check box.
If you want to turn it on (or off) in the project setting, you have to go to: Configuration Properties -> C/C++ -> Command Line and then under Additional Options you can enter: /w3#### to set your warning to level 3, and thus enable it; or you can enter /wd#### to disable a warning.
In later versions of Visual Studio, additional security checks are enabled by default on new projects, which makes the warning you see be treated as an error.
So, in addition to the actions in the suggested duplicate questions, you may also need to do the following.
Right click on the project in the solution explorer and choose Properties from the menu, then make sure you turn off SDL checks as shown in the following screenshot:
UPDATE (This alone worked for me):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With