keil报错(reentrant用法)
源程序:#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文件)