Visual Studio 2013 doesn't ignore disabled warnings

后端 未结 3 526
青春惊慌失措
青春惊慌失措 2020-12-16 17:24

Good morning all. So I\'m attempting to disable Warning 4996 in our c++ projects. It seems to be included in the command line as shown below, but upon compiling, still pops

3条回答
  •  Happy的楠姐
    2020-12-16 18:11

    It looks like #pragma warning(disable: 4996) will not disable the MBCS deprecation warning due to the #pragma warning(1: 4996) before the _declspec(deprecated) line in afx.h

    For obscure reasons, you must use #define NO_WARN_MBCS_MFC_DEPRECATION to disable this instead.

    see afx.h lines 28-33

    #ifndef NO_WARN_MBCS_MFC_DEPRECATION
    #ifdef _MBCS
    // Warn about MBCS support being deprecated: see http://go.microsoft.com/fwlink/p/?LinkId=279048 for more information.
    #pragma warning(push)
    #pragma warning(1 : 4996)
    inline __declspec(deprecated("MBCS support in MFC is deprecated and may be removed in a future version of MFC.")) void MBCS_Support_Deprecated_In_MFC() { }
    

提交回复
热议问题