BBS水木清华站∶精华区

发信人: zoei (雨霖霖), 信区: Linux        
标  题: 扔掉硬盘之无盘工作站指南(五) 
发信站: BBS 水木清华站 (Mon May 15 18:27:14 2000) 
 
 
在gcc-2.1.x中,strlen()及strcmp()函数定义及使用 
在此源程序中的mknbi-mgl/mglparse.y文件不一样. 
一次编译便不能通过.解决办法是修改一下mglparse.y 
 
--- mknbi-mgl/mglparse.y.orig   Sun Jan  3 21:38:29 1999 
+++ mknbi-mgl/mglparse.y        Tue Apr 11 12:34:19 2000 
@@ -2373,7 +2373,7 @@ 
                        struct expr *ep; 
 
                        /* We need this for the code generator */ 
-                       static struct sym strlen = { 
+                       static struct sym str_len = { 
                                funcsym, "", 0, -1, { 
                                  { 0, 0, CMD_STRLEN, 1, &int_type, 
                                    { &string_type }, 
@@ -2387,11 +2387,11 @@ 
                            exprtype($1) == EXPR_STRING && 
                            $3 != NULL && !strcmp($3->name, "len")) { 
                                ep = newexpr(); 
                            $3 != NULL && !strcmp($3->name, "len")) { 
-                               ep->type = strlen.def.f.ret; 
-                               ep->opcode = strlen.def.f.opcode; 
-                               ep->exprnum = strlen.def.f.argnum; 
+                               ep->type = str_len.def.f.ret; 
+                               ep->opcode = str_len.def.f.opcode; 
+                               ep->exprnum = str_len.def.f.argnum; 
                                ep->exprlist[0] = reorg($1); 
-                               ep->spec.func = &strlen; 
+                               ep->spec.func = &str_len; 
                                $$ = ep; 
                                break; 
上面中减号是指去掉相应的行,加号是指增加相应的行.(其实就是把strlen改成 
str_len) 
 
修改完后,便可以编译通过了. 
 
to be continued... 
 
-- 
假如我有时间 
      我会对你说:我爱你! 
                 不过,我有时间吗? 
 
-- 
※ 来源:·BBS 水木清华站 smth.org·[FROM: 202.118.74.64] 

BBS水木清华站∶精华区