简体   繁体   English

如何将警告C4715转换为错误

[英]How to convert warning C4715 to error

I am building cpp files using msys Make.exe , and getting the below warning c:\\ankit_cc\\wm2015git\\wm-cpp\\base\\wmautomator\\base\\wmautomator.cpp(1047) : warning C4715: 'WMAutomator::fetchSerialNumbersBasedOnLpn' : not all control paths return a value ; 我正在使用msys Make.exe构建cpp文件,并收到以下警告c:\\ ankit_cc \\ wm2015git \\ wm-cpp \\ base \\ wmautomator \\ base \\ wmautomator.cpp(1047):警告C4715:'WMAutomator :: fetchSerialNumbersBasedOnLpn':并非所有的控制路径都返回一个值;

I want to make this above warning to error . 我想使以上警告成为错误。 Please suggest . 请提出建议。

Two ways of doing this 两种方法

  • #pragma warning (error : 4715)

http://msdn.microsoft.com/en-us/library/2c8f766e.aspx http://msdn.microsoft.com/en-us/library/2c8f766e.aspx

  • Compiling with /we4715 option passed to cl.exe 使用传递给cl.exe /we4715选项进行编译

http://msdn.microsoft.com/en-us/library/thxezb7y.aspx http://msdn.microsoft.com/en-us/library/thxezb7y.aspx

Pass 通过

/we4715

to the compiler in your makefile. 生成文件中的编译器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM