新秀問題FYI。警告:函數聲明中的參數名稱(不帶類型)
每當我編譯/運行代碼,extern tolayer2(rtpktTo1);我收到警告。 警告內容,如標題,警告:在函數聲明
參數名稱(無類型的)任何幫助表示讚賞。
node0.c
extern struct rtpkt {
int sourceid; /* id of sending router sending this pkt */
int destid; /* id of router to which pkt being sent
(must be an immediate neighbor) */
int mincost[4]; /* current understanding of min cost to node 0 ... 3 */
};
/* Create routing packets (rtpkt) and send to neighbors via tolayer2(). */
struct rtpkt rtpktTo1;
rtpktTo1.sourceid = 0;
rtpktTo1.destid = 1;
rtpktTo1.mincost[0] = minCost[0];
rtpktTo1.mincost[1] = minCost[1];
rtpktTo1.mincost[2] = minCost[2];
rtpktTo1.mincost[3] = minCost[3];
extern tolayer2(rtpktTo1);
prog3.c
tolayer2(packet)
struct rtpkt packet;
{
/* This has a lot of code in it */
}
非常感謝! – 2011-04-19 07:39:49