Why disable specific warning not working in Visual Studio

With Visual Studio C++ 2013, I have a lot of warning C4100: unreferenced formal parameter, and I want to disable that. I added 4100 to the "Disable Specific Warnings" in the project for both Debug|Release configurations but unfortunately VS still output the warnings.

I was using VS2008, and the Disable Specific Warning was working but now with VS2013, it doesn't. What I'm doing wrong?

EDIT:

Compiler command line :

/GS /analyze- /W3 /wd"4100" /Zc:wchar_t /I [...] /Zi /Gm- /Od /Fd".\" /fp:precise /D "_WIN32_WINNT=0x0601" /D "_CRT_SECURE_NO_WARNINGS" /D [...] /errorReport:prompt /WX- /Zc:forScope /GR /Gd /Oy- /MDd /Fa"debug\" /EHsc /nologo /Fo"debug\" /Fp"debug\project1.pch"

Additionnal options:

-Zm200-w34100-w34189/MP






down vote accepted

This was driving me nuts for a while now. My problem was that Qt's default qmake.conf for win32-msvc2013 (look under qtdir\mkspecs) contains the following line: QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189

You didn't say you were using Qt, but the -w34100 parameter sets warning 4100 to be seen at the W3 level instead of the W4 level. This will have precedence over the -wd4100, hence you'll still see the warnings. For those of us using qt you can either add QMAKE_CXXFLAGS_WARN_ON -= -w34100 to your .pro file or remove the argument in the mkspecs folder.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值