Visual Studio 2013不会忽略禁用的警告 [英] Visual Studio 2013 doesn't ignore disabled warnings

查看:841
本文介绍了Visual Studio 2013不会忽略禁用的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好。所以我试图禁用警告4996在我们的c + +项目。它似乎被包括在命令行中,如下所示,但编译时,仍然弹出与C4966警告。我试图将警告级别更改为3,或使用/ w44996,但都没有工作。

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 up with the C4966 Warning. I've tried changing the warning level to 3, or using /w44996, but neither have worked. Does anyone know why this might be?

/Yu"stdafx.h" /GS- /W4 /wd"4100" /wd"4121" /wd"4201" /wd"4214" /wd"4244" /wd"4996" /Zc:wchar_t /I"C:\Program Files (x86)\MSBuild\..\Common Files\Microsoft Shared\MSEnv" /I"C:\Program Files (x86)\MSBuild\..\Common Files\Designer" /I"D:\Workspaces\MST_Sustaining_Second\Inc" /I"D:\Workspaces\MST_Sustaining_Second\Develop\Shared\Include" /Zi /Gm /Od /Fd"D:\Workspaces\MST_Sustaining_Second\Develop\IDE\GrACE\Debug\vc120.pdb" /fp:precise /D "_USRDLL" /D "ACE_DLL" /D "IQEDITOR_ENABLED" /D "_WINDOWS" /D "_DEBUG" /D "NTDDI_VERSION=NTDDI_WIN7" /D "_WIN32_WINNT=0x0601" /D "WINVER=0x0601" /D "_AFXDLL" /D "WIN32" /D "_SECURE_SCL=0" /D "_WINDLL" /D "_MBCS" /errorReport:prompt /GF- /WX- /Zc:forScope /RTC1 /Gd /Oi /MDd /Fa"D:\Workspaces\MST_Sustaining_Second\Develop\IDE\GrACE\Debug\" /EHs /nologo /Fo"D:\Workspaces\MST_Sustaining_Second\Develop\IDE\GrACE\Debug\" /Fp"D:\Workspaces\MST_Sustaining_Second\Develop\IDE\GrACE\Debug\ace.pch" 

编辑:在说明中输入错误。我的意思是警告4996,而不是4966. 4996在命令行中为/ wd4996

Typo in description. I do mean Warning 4996, not 4966. 4996 is in the command line as /wd"4996"

对于警告:

warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.


推荐答案

看起来像 #pragma警告(禁用:4996)不会禁用由于
#pragma警告(1:4996)之前的MBCS弃用警告 _declspec(deprecated) afx.h中的行

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

由于模糊的原因,必须使用 #define NO_WARN_MBCS_MFC_DEPRECATION 可禁用此功能。

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

请参阅afx.h第28-33行

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() { }

这篇关于Visual Studio 2013不会忽略禁用的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆