发 帖  
【四旋翼飞行器】76小时吃透四轴算法!史上最强软硬结合实战项目,👉戳此立抢👈
[问答] xc8 v2 - 未解决的#include <alloca.h>包含在内。\xc8\v2.00\pic\ include\ c99 \ stdlib.h
574 库文件 XC8
分享
编译成功后(没有错误),在C源文件中,我注意到一个Sigggy行,在下面的C.L.H.G.T中,按住Ctrl键并点击它,下面的消息出现了:库文件C:\程序文件(x86)\Microchip \xC8\v2.00 \pic包含\xC.H.但是还有一个未解决的i包含在C中:\\程序文件(x86)\Microchip \xC8\v2.00 \pic包含\c99 \sdllb.。这是一个关于V2编译器的WIP。谢谢,格伦。

以上来自于百度翻译


      以下为原文

    After compiling successfully (no errors)
, I notice a squiggly line under the #include <xc.h> in the .c source file.

Holding down the Ctrl key and mousing over it, the following message appears:

Library File C:\Program Files (x86)\Microchip\xc8\v2.00\pic\include\xc.h
but there is an unresolved #include <alloca.h>
in included C:\Program Files (x86)\Microchip\xc8\v2.00\pic\include\c99\stdlib.h

Is this something to be concerned about or is this a WIP for the v2 compiler.

Thanks,
Glenn
0
2018-9-5 16:18:52   评论 分享淘帖 邀请回答
6个回答
在一个小图片上使用堆并没有什么意义,所以你可以很容易地摆脱它。看起来,微软正开始尽可能“均衡”AVR/ATMEGA和PIC1X设备。对所有口味的*AlcReuny[*/*Fiel]()的支持可能来自Atmel工具链,由于显著的架构差异,它有点不同。

以上来自于百度翻译


      以下为原文

    Using a heap on a small PIC doesn't make much sense, so you can easily get away with that.
 
Looks as if Microsoft is starting to "equalize" AVR/ATmega and PIC1x devices as far as possible. The support for *alloc() /*free() of all flavours might come from the Atmel tool chain which is somewhat different due to significant architectural differences.
2018-9-5 16:38:44 评论

举报

ALLCONA不使用堆,并且不与MalC/Cype相关。它从堆栈中分配,并在退出它所调用的函数时自动释放存储。它不是标准的C函数(它来自UNIX世界),我不知道它是否甚至在XC8中得到支持。

以上来自于百度翻译


      以下为原文

   
 
alloca does not use a heap and is not related to malloc/free.  It allocates from the stack and automatically releases the storage when exiting the function from which it's called.  It's not a standard C function (it comes from the UNIX world), and I don't know if it's even supported in XC8.
2018-9-5 16:49:57 评论

举报

要注意的重要特性:忽略头文件和设备定义下的红色曲线。当你建造一个项目,当你离开MLAX并重新进入,当你忘了在夏至午夜的时候,把你的头埋在你的后廊台阶上,还有其他一些不明确的,通常是不可知的、不可预知的和不可重复的条件时,它们就来来去去。这是一个“P”。在这个论坛上一次又一次地被曝光。它是一个NETBeOne(由Java程序员创建的)。没有确凿的解决方法,只需创建一个“真正”的程序并尝试编译。如果编译器不高兴,它会告诉你具体什么是错误的。(有时你编好了红色的斜纹棉布就走了,只是在将来某个不确定的时间回来。)我的建议是:咬紧牙关忍受它。然后尝试一些冥想技巧来帮助你不要咬牙切齿。(这就是我的工作).ld:sdllb. h & gt;其中包含allas.h & gt;由一些条件编译器预处理器语句分隔,并且不会是任何“正常”XC8编译的一部分。在xC8版本2分发中没有llt;allas.h & gt,因此不能使用。即使你想这么做。你不应该想:DU000 00 01给出好的建议。事实上,正如Jutple指出的那样,GNU-ALROCA不使用堆,但它仍然是一个坏主意(在我看来)对于一个小的PIC——就像XC8所覆盖的。

以上来自于百度翻译


      以下为原文

    Important "features" to note:

  • Ignore red squiggly lines under header files and under device definitions.  They come and go when you build a project and when you exit MLABX and re-enter, and when you forgot to bury a chicken's head under your rear porch step at midnight on Summer Solstice, and for a few other unspecified and, generally, unknowable, unpredictable, and unrepeatable conditions.

    This is a "problem" that has been brought to light time after time after time on this forum.  It is a Netbeans (created by for and of Java Programmers) thing. There is no proven workaround.

    Just create a "real" program and try to compile.  If the compiler is unhappy, it will tell you specifically what is wrong.  (Sometimes after you compile the red squigglies go away, only to return at some unspecified time in the future.)

    My suggestion: Grit your teeth and bear it.  Then try some meditation technique to help you not to grit your teeth so much.  (That is what Works For Me)
  • The place in <stdlib.h> where it includes <alloca.h> is delimited by some conditional compiler preprocessor statements, and will not be part of any "normal" XC8 compilations.
  • There is no <alloca.h> in the XC8 version 2.00 distribution so you couldn't use it even if you wanted to.  And you shouldn't want to: du00000001 gives Good Advice.  Well, actually, as jtemples points out, GNU alloca doesn't use the heap, but it still would be a Bad Idea (in my opinion) for an small PIC---like the ones covered by XC8.
 
Regards,
 
Dave
2018-9-5 17:00:33 评论

举报

@ JTMPLESSI一直在学习……-虽然使用编译过的堆栈,但是分配给它可能有点困难,但是考虑它应该在一些头文件中,它要么被用户使用,要么被一些服务例程使用。这些都是非常可取的。我已经检查过以前的版本(1.3x,1.45):没有一个包含这样一个文件,尽管它们在CALLoE()中运动,并且在一个头部中有更多的运动。加上相应的* For()例程。

以上来自于百度翻译


      以下为原文

    @ jtemples
I'm ever learning...
Although - with a compiled stack it might be somewhat hard to alloca() then 
Considering it should be in some header file, it is either intended to be used by the user or by some service routine. None of these highly desirable.

I've checked previous versions (1.3x, 1.45): none of these incorporates such a file, although they sport calloc() and a bit more in one of the headers. Plus the corresponding *free() routines.
2018-9-5 17:08:51 评论

举报

此外,当C99标准被选择时,这个问题似乎只发生(至少对我来说),选择C90它不出现。这两种情况都不会造成编译器错误或警告,只有红色的斜纹。MPLAB X!

以上来自于百度翻译


      以下为原文

    Also this issue appears to only occur (at least for me) when the c99 standard is selected, selecting c90 it does not appear. Neither case actually trips a compiler error or warning, only the red squiggles. MPLAB X!
2018-9-5 17:19:03 评论

举报

我有一个模糊的记忆,原来的高科技编译器有一个x86版本,也许这就是从哪里来的。

以上来自于百度翻译


      以下为原文

    I have a vague memory of the original Hi-Tech compiler having an x86 version; maybe that's where alloca came from.
2018-9-5 17:35:19 评论

举报

只有小组成员才能发言,加入小组>>

24个成员聚集在这个小组

加入小组

创建小组步骤

关闭

站长推荐 上一条 /8 下一条

快速回复 返回顶部 返回列表