禁用Eclipse的错误发现。 (Codan假阳性) [英] Disable Eclipse's error discovery. (Codan false positives)

查看:151
本文介绍了禁用Eclipse的错误发现。 (Codan假阳性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的经验到现在为止,Eclipse的错误发现是非常糟糕的,没有任何解决方案(Tried __ GXX_EXPERIMENTAL_CXX0X __ -std = c ++在附近的每个设置点,0x -std = c ++ 11 我现在不想再搜索一个解决方案了。现在我只想看到真正的编译错误。但是如何完成这个?

解决方案

更新:答案已经过时了。我今天(2014年3月15日)仔细检查:在Eclipse Kepler(Build id 20130614-0229)中,只要




  • 在项目>属性>C / C ++构建>设置下添加,然后在工具设置选项卡上添加GCC C ++编译器>其他 -std = c ++ 11 标志,


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



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


  • 清理并重建您的项目您的索引(<因为Eclipse倾向于缓存错误消息并显示它们,即使在更改设置后它们不见了。




这可以在我的机器上运行。如果不在你的机器上,那么你可能想给一个镜头: C++11在Eclipse上的完全支持,尽管我不确定这种方法的正确性,也没有必要在我的机器上这样做。截至2014年3月7日,用户声明,它帮助了他们,而上述方法没有。






2012年以前的原始帖子已经过时了:




这些虚伪错误来自柯顿。我还发布了一个错误报告( C ++ 03 !!!)但同样的问题出现在最新的稳定的Eclipse中,所以我不认为发生了很多事情:(



解决方法:



点击项目属性,然后单击C / C ++常规>代码分析>语法和语义错误,并取消选择任何错误的错误你正在得到。


我只想看到真正的编译器错误


当然,您可以完全禁用静态分析,在这种情况下,您可以完成您想要的。






更新: 2位用户已经报告了Jeevaka写的帮助他们,我尝试了他写的,它没有帮助我与Juno SR1和CDT 8.1.1,也许Codan开发人员在Juno SR2和CDT 8.1.2


$中改进了静态分析b $ b


My experience until now is, that the error discovery of Eclipse is horribly buggish without any solutions (Tried __GXX_EXPERIMENTAL_CXX0X__, -std=c++0x, -std=c++11 in nearby every point of the settings). I am at the point that I dont want to search for a solution no more. Now I just want to see solely real compiler errors. But how to accomplish this?

解决方案

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

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

  • 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}"

  • 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.

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.


The original post from 2012, now outdated:

These bogus errors come from Codan. I also issued a bug report (C++03!!!) but the same problem shows up in the latest stable Eclipse so I don't think much has happened :(

Workaround:

Click on the project properties, then C/C++ General > Code Analysis > Syntax and Semantic Errors and deselect whatever false errors you are getting.

I just want to see solely real compiler errors

Of course, you can disable there the static analysis completely, in that case you can accomplish exactly what you want.


UPDATE: 2 users have reported that what Jeevaka wrote helped them. I have tried what he wrote, it did not help me with Juno SR1 and CDT 8.1.1. Perhaps Codan developers have improved static analysis in Juno SR2 and CDT 8.1.2

这篇关于禁用Eclipse的错误发现。 (Codan假阳性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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