Jef*_*f M 7 c++ msbuild visual-studio visual-studio-2017
我记得这个技巧在过去的某个时间有效,但现在似乎没有奏效.
把#pragma warning(push, 0)周围的#include语句实际上并没有阻止/Wall警告,从这些文件中包含的生成.
改变/Wall以/W4解决问题,但使用/Wall似乎被打破.
#pragma warning(push, 0)
#include <iostream>
#pragma warning(pop)
int main() {
std::cout << "Hello, World!";
}
Run Code Online (Sandbox Code Playgroud)
构建输出:
Microsoft Visual Studio社区2017版本15.5.3
完整的命令行开关(从cmake生成):
/GS /TP /analyze- /Wall /Zc:wchar_t /Gm- /O2 /Ob2 /Fd"main.dir\Release\vc141.pdb" /Zc:inline /fp:precise /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "CMAKE_INTDIR=\"Release\"" /D "_MBCS" /errorReport:prompt /WX /Zc:forScope /GR /Gd /Oy- /MD /std:c++14 /Fa"Release/" /EHsc /nologo /Fo"main.dir\Release\" /Fp"main.dir\Release\main.pch" /diagnostics:classic
Run Code Online (Sandbox Code Playgroud)
我google了一下,发现了一个似乎描述同一问题的帖子,但没有提出任何解决方案.希望StackOverflow上的人们有更好的主意吗?
| 归档时间: |
|
| 查看次数: |
286 次 |
| 最近记录: |