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

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

问题描述

我现在的经验是,Eclipse的错误发现是没有任何解决方案可怕的buggish尝试 __ GXX_EXPERIMENTAL_CXX0X __ -std = c ++ 0x -std = c ++ 11 )。我在这一点,我不想搜索一个解决方案不再。现在我只想看到真正的编译器错误。但是如何实现这一点呢?

解决方案

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




  • 工具 c> -std = c ++ 11 标志,


  • > 选项卡上选择 CDT GCC内置编译器设置并添加 -std = c ++ 11 code>标志到命令以获取编译器规格。在我的机器上,更改后看起来像这样:



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


  • 清除并重建您的项目


>

这在我的机器上可以正常工作。如果它不在你的机器上,那么你可能想要拍摄这个: C++11 Eclipse上的完全支持虽然我既不确定这种方法的正确性,也不需要在我的机器上这样做。自2014年3月7日起,用户声明它帮助他们,而上述方法没有。






2012年的原始讯息,现已过时:




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



解决方法: p>

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


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


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






UPDATE: 2个用户报告了Jeevaka写的帮助他们,我试过他写的,它没有帮助我与Juno SR1和CDT 8.1.1。或许Codan开发人员改进了静态分析Juno SR2和CDT 8.1.2




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天全站免登陆