jwenjian/ghiblog

C++: Ignore warnings C4996

jwenjian opened this issue · 0 comments

C4996 occurs when the compiler encounters a function or variable that is marked as deprecated by using a __declspec(deprecated) modifier, or when you attempt to access a function, class member or typedef that has the C++14 [[deprecated]] attribute.

To ignore the warnings, do in below ways:

  1. In cpp file
#pragma warning(disable : 4996)
  1. In Commond line:
    Using the /wd4996 command line option.

  2. In Visual Studio:

  • Open the Property Pages dialog for your project. For information on how to use the Property Pages dialog, see Property Pages.
  • Select the Configuration Properties, C/C++, Advanced page.
  • Edit the Disable Specific Warnings property to add 4996. Choose OK to apply your changes.

Refer to : https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=vs-2019