为什么Codan找不到size_t? [英] Why can't Codan find size_t
问题描述
我刚刚开始使用Eclipse Indigo(来自伽利略),而且每次使用size_t时,我都会在沟槽中收到一些小错误。
代码编译没有问题,但我怀疑我必须显式添加一个路径到include目录。我已经在那里有通常的嫌疑犯。我正在使用Gnu工具链对ColdFire处理器进行交叉编译,因此除了包含m68k-elf之外的mfg芯片的标准包括,还包括
\include
\include\c ++ \4.2.1
\include\c ++ \4.2.1\include
\include \c ++ \4.2.1\m68k-elf
更新
我注意到这个工具链存在的唯一的地方stddef.h是一个 lib
目录
gcc-m68k\lib\gcc\m68k-elf\4.2.1\include
我从父母中添加了该路径,父路径和 \include-fixed
,但问题仍然存在。
测试说明
当测试有效和什么不注意到一些事情
- 修改代码分析偏好setti时,代码分析不会被重新触发我仍然需要修改一个编辑器(只需添加一个空格)
- 关闭
的代码分析设置不符号符号
不会使错误消失。 - 关闭所有
,触发分析,重新开始,然后关闭
符号未解决
保持错误不再出现。
在首选项 - > C / C ++ - >索引器下检查索引器设置。 p>
有一个字段称为提交到前端索引。其内容应该是:
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
。在较新版本(伽利略和靛蓝)中,将其改为上述,但由于此字段是偏好的一部分,如果出口您的Ganymede偏好,并将其导入伽利略/靛蓝,这个领域被旧的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
- 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)
- Turning off the Code analysis setting for
Symbol is not resolved
will not make the error go away. - Turning off all
Syntax and Semantic Errors
, triggering the analysis, going back in and turning them all back on and then turning offSymbol 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屋!