Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE

前端 未结 10 1620
说谎
说谎 2020-12-02 06:00

What is the best way to disable the warnings generated via _CRT_SECURE_NO_DEPRECATE that allows them to be reinstated with ease and will work across Visual Stud

10条回答
  •  时光说笑
    2020-12-02 06:33

    You could disable the warnings temporarily in places where they appear by using

    #pragma warning(push)
    #pragma warning(disable: warning-code) //4996 for _CRT_SECURE_NO_WARNINGS equivalent
    // deprecated code here
    #pragma warning(pop)
    

    so you don't disable all warnings, which can be harmful at times.

提交回复
热议问题