为什么Codan不能找到size_t [英] Why can't Codan find size_t

查看:180
本文介绍了为什么Codan不能找到size_t的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Eclipse Indigo(来自Galileo),并且每次使用size_t时,我都会在水槽中收到一些红色的错误。



>



代码编译没有问题,但我怀疑我必须显式地添加一个路径到include目录。我已经有常见的嫌疑犯在那里。我使用Gnu工具链对ColdFire处理器进行交叉编译,除了标准包括来自mfg的芯片我有m68k-elf

下包含的


  \include 
\include\c ++ \4.2.1
\include\c ++ \4.2.1\include
\include \c ++ \4.2.1\m68k-elf



更新



我注意到这个工具链中只有一个位于 lib 目录中的位置stddef.h

  gcc-m68k\lib\gcc\m68k-elf\4.2.1\include 

我添加了路径,父路径和 \include-fixed 从父级,但问题仍然存在。



测试注意事项



测试什么有效, p>


  1. 代码分析在修改代码分析首选项设置时不会重新触发,我仍然需要更改编辑器(只需添加一个空格)

  2. 关闭符号的代码分析设置未解决将不会使错误消失。

  3. 关闭所有语法错误和语义错误,触发分析,重新开启并将其全部重新开启,然后关闭符号未解析使错误不再出现。


解决方案

在首选项 - > C / C ++ - >索引器下检查索引器设置。 p>

有一个名为Filed to index up-front的字段。其内容应为:

  cstdarg,stdarg.h,stddef.h,sys / resource.h,ctime,sys / types .h,signal.h,cstdio 

如果其中还有其他东西,上面,然后重建索引,并看看是否解决了这个问题。



(特别是,如果你在该字段是 stdarg。 h,stddef.h,sys / types.h ,然后我有一个很好的猜测,什么地方出了错。回到Eclipse Ganymede,这个字段的值是 stdarg .h,stddef.h,sys / types.h 。在较新的版本(Galileo和Indigo)中,它被改为上面的,但是由于这个字段是preferences的一部分,导出您的Ganymede首选项并将它们导入Galileo / Indigo,该字段被旧的Ganymede值覆盖,我刚才被烧了。)


I've just started using Eclipse Indigo (coming from Galileo) and I'm getting little red bugs in the gutter for every use of size_t.

The code compiles without issue but I suspect I have to explicitly add a path to the include directories. I already have the usual suspects in there. I am cross compiling for a ColdFire processor using the Gnu tool chain so in addition to the standard include from mfg of the chip I have the includes under m68k-elf

\include  
\include\c++\4.2.1
\include\c++\4.2.1\include
\include\c++\4.2.1\m68k-elf

Update

I noticed that the only place stddef.h exists for this toolchain is in a lib directory

gcc-m68k\lib\gcc\m68k-elf\4.2.1\include

I added that path, the parent path and \include-fixed from the parent but the problem still exists.

Note on testing

When testing what works and what doesn't I noticed a couple of things

  1. Code analysis does not get re-triggered when modifying Code Analysis preference settings, I still need to make an editor change (simply adding a space works)
  2. Turning off the Code analysis setting for Symbol is not resolved will not make the error go away.
  3. Turning off all Syntax and Semantic Errors, triggering the analysis, going back in and turning them all back on and then turning off Symbol is not resolved keeps the error from reappearing.

解决方案

Check your indexer settings under Preferences -> C/C++ -> Indexer.

There is a field there called "Filed to index up-front". Its contents should be:

cstdarg, stdarg.h, stddef.h, sys/resource.h, ctime, sys/types.h, signal.h, cstdio

If there is something else in there, try replacing it with the above, then rebuild the index, and see if that fixes the problem.

(In particular, if what you have in that field is stdarg.h, stddef.h, sys/types.h, then I have a pretty good guess as to what went wrong. Back in Eclipse Ganymede, the value of this field was stdarg.h, stddef.h, sys/types.h. In newer versions (Galileo and Indigo), it was changed to the above. However, since this field is part of "preferences", if you exported your Ganymede preferences and imported them into Galileo/Indigo, this field was overwritten with the old Ganymede value. I was burned by this a while ago.)

这篇关于为什么Codan不能找到size_t的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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