关闭月食错误(不是真正的错误) [英] Turn off eclipse errors (that aren't really errors)

查看:76
本文介绍了关闭月食错误(不是真正的错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

禁用Eclipse的错误发现。 (Codan误报)

到目前为止,已支持GCC 4.8 / Clang 3.3在Eclipse进行语法检查之前(在功能支持方面),Eclipse将许多东西标记为实际上是有效代码的错误(模板别名碰巧是我的主要问题,但是还有其他问题)。

With GCC 4.8/Clang 3.3 C++ support so far ahead of what Eclipse is doing with syntax checking (in terms of feature support), Eclipse is marking many things as errors that are actually valid code (template aliasing happens to be my main problem, but there are other issues as well).

当我编译(或尝试进行任何操作时,遇到一些问题,请参见(更多)。无论编译器正好在做什么工作,它的错误都会传播出去,但是它说的没问题的代码仍然强调(红色和金色蜘蛛分别表示错误和警告),这使得查看情况变得更加困难。

When I compile (or attempt to anyway, having some issues, see here for more) whatever compiler happens to be doing the work does its job, and its errors get propagated through, but the code that it says is OK is still underlines (red and gold spiders for errors and warnings respectively), which makes it much harder to see what is going on.

是否有一种方法可以消除这些错误/警告?

Is there a way to get rid of these errors/warnings?

更好的方法是仅在尝试编译后摆脱警告,只要代码的相关部分保持不变,但仍使它们始终保持启用状态即可。

Even better would be a way to get rid of warnings only after compile attempt, and for as long as the relevant parts of the code don't change, but still leave them enabled in general.

(实际上最好的选择是支持Eclipse的插件全部,或者至少比Juno本身更多,但我似乎找不到)

(Actually the best would be a plugin for Eclipse that supports all, or at least more of C++11 than Juno does by itself, but I can't seem to find that)

推荐答案

更新:自从我发布原始答案已经很久了,它已经过时了。我今天(2014年3月15日)仔细检查了一下:在Eclipse Kepler(版本ID 20130614-0229)中,

UPDATE: It's been a long time since I posted the original answer and it has become outdated. I double-checked today (Mar 15, 2014): in Eclipse Kepler (Build id 20130614-0229) it is sufficient to


  • Project> Properties> C / C ++ Build> Settings 下添加,然后在 Tool Settings 选项卡上 GCC C ++ Compiler>其他 -std = c ++ 11 标志,

  • add under Project > Properties > C/C++ Build > Settings then on the Tool Settings tab GCC C++ Compiler > Miscellaneous the -std=c++11 flag,

然后在 Window> Preferences> C / C ++> Build下>发现 选项卡上的设置 选择 CDT GCC内置编译器设置 ,并添加 -std = c ++ 11 标记为命令以获取编译器规范。在我的机器上,更改后看起来像这样:

then under Window > Preferences > C/C++ > Build > Settings on the Discovery tab chose CDT GCC Built-in Compiler Settings and add the -std=c++11 flag to Command to get compiler specs. On my machine it looks like this after the change:

$ {COMMAND} -E -P -v -dD -std = c ++ 11 $ {INPUTS}

清理并重建项目 Project> C / C ++ Index> Rebuild ),因为Eclipse倾向于缓存错误消息并显示错误消息,即使更改设置后这些错误消息也消失了。

clean and rebuild both your project and your index (Project > C/C++ Index > Rebuild) as Eclipse tends to cache error messages and show them even though they are gone after changing the settings.

这肯定可以在我的机器上使用。如果您的计算机上没有,请尝试一下:Eclipse上的C ++ 11全面支持,尽管我不确定这种方法的正确性,也没有必要在我的机器上这样做。截至2014年3月7日,用户声称可以帮助他们,而上述方法

This works on my machine for sure. If it doesn't on yours, then you might want to give a shot to this: C++11 full support on Eclipse although I am neither sure about the correctness of this approach nor was it necessary to do it on my machine. As of March 7, 2014 users claim that it helped them whereas the above approach didn't.

原始帖子,现在已过时:

这些虚假错误来自柯丹。整个问题是因为Codan和编译器对C ++ 的理解不同, Codan是越野车

These bogus errors come from Codan. The whole thing is because Codan and the compiler have different understanding of C++ and Codan is buggy.

可能的解决方法


  1. 单击项目属性,然后单击 C / C ++常规>代码分析>语法和语义错误 ,然后取消选择任何错误的错误越来越。缺点:您很可能最终会禁用大多数错误并逐个警告,这很烦人。

  1. Click on the project properties, then C/C++ General > Code Analysis > Syntax and Semantic Errors and deselect whatever false errors you are getting. Drawback: you will most likely end up disabling most of the errors and warning one by one, which is quite annoying.

C / C ++常规>代码分析>语法和语义错误。您不会从Codan中获得真正的错误,而只能从编译器中获得真正的错误。

Disable the static analysis completely at C/C++ General > Code Analysis > Syntax and Semantic Errors. You won't get the true errors from Codan but only later from the compiler.

没有一个是解决方案但至少您仍然可以使用Eclipse IDE。

None of them is a solution but at least you can still use the Eclipse IDE.

这篇关于关闭月食错误(不是真正的错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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