keil报错(reentrant用法)

daagaoying daagaoying 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
源程序:#include "httpd.h"
#include "fs.h"

#include <stdio.h>
#include <string.h>

static u8_t print_stats(u8_t next) reentrant;
static u8_t file_stats(u8_t next);
static u8_t tcp_stats(u8_t next) reentrant;

cgifunction code cgitab[] = {
print_stats, /* CGI function "a" */
file_stats, /* CGI function "b" */
tcp_stats, /* CGI function "c" */
};

static u8_t
print_stats(u8_t next)reentrant
{...}

static u8_t
file_stats(u8_t next)
{...}

static u8_t
tcp_stats(u8_t next)
{...}

Build target 'Target 1'
compiling cgi.c...
CGI.C(75): warning C182: pointer to different objects
CGI.C(77): warning C182: pointer to different objects
CGI.C(182): error C231: 'tcp_stats': redefinition
Target not created

重点是:
static u8_t print_stats(u8_t next) reentrant;
static u8_t file_stats(u8_t next);
static u8_t tcp_stats(u8_t next) reentrant;部分
原来我没有添加reentrant是, keil的报警是:
*** WARNING L13: RECURSIVE CALL TO SEGMENT
SEGMENT: ?CO?CGI
CALLER: ?PR?_PRINT_STATS?CGI
*** WARNING L13: RECURSIVE CALL TO SEGMENT
SEGMENT: ?CO?CGI
CALLER: ?PR?_TCP_STATS?CGI
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_ETHERDEV_DELAY_MS?ETHERDEV
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_UIP_UNLISTEN?UIP

然后我依据网上的建议添加了reentrant关键字,又有新的问题出现了。
请哪位大侠告诉我应该怎么改!不胜感激(上述程序为uIP0.9中的cgi.c文件)
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
daagaoying
单片机/工控 27,522 成员 28,796 内容