简体   繁体   English

错误提示列表中并不总是显示“ #warning”

[英]“#warning” not always being shown in the Error List

I use this to mark code I need to come back to: 我用它来标记代码,我需要回到:

#warning Do more stuff here

However, sometimes these warning don't show up in the Error List window after a build. 但是,有时这些警告在构建后不会出现在“错误列表”窗口中。 I can see the warnings in the compiler output window, but only some of them make it into the Error List. 我可以在编译器输出窗口中看到警告,但是只有其中一些警告进入了错误列表。 If I have the code file open that has these warnings they are always shown. 如果我打开了包含这些警告的代码文件,它们将始终显示。 If I have the code file closed, they don't appear most of the time. 如果我关闭了代码文件,它们通常不会出现。 Is there a setting I can change to adjust this behaviour and always show the warnings in the Error List? 是否可以更改设置以调整此行为,并始终在错误列表中显示警告?

The reason is that, even if a warning occurs, the compiler normally considers this source file to be ok. 原因是,即使发生警告,编译器通常也认为此源文件正常。 So in an incremental build, the source file isn't recompiled, and the warning isn't displayed. 因此,在增量构建中,不会重新编译源文件,并且不会显示警告。

如果您进行重建,它们应该出现

在项目属性的“构建”选项卡中,选择“将警告视为错误->全部”单选按钮。

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

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