changeset 559:c55b51d51f8f

*** empty log message ***
author kono
date Sat, 07 Jan 2006 13:09:45 +0900
parents 528fed826f17
children d6ff45d719a5
files Changes mc-parse.c mc.h test/strinit.c
diffstat 4 files changed, 26 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Changes	Sat Jan 07 12:46:38 2006 +0900
+++ b/Changes	Sat Jan 07 13:09:45 2006 +0900
@@ -7980,7 +7980,10 @@
 default が来たら、残りは全部無視して良いわけ?
 
 
-
-
-
-
+インタフェースの順序を大きい順にすると、コピーの
+被害が少ないが....
+
+string の共有はやらないの? hash table にまで、いれたのに。
+
+まぁ、でも、そろそろ封印だな。
+
--- a/mc-parse.c	Sat Jan 07 12:46:38 2006 +0900
+++ b/mc-parse.c	Sat Jan 07 13:09:45 2006 +0900
@@ -305,6 +305,7 @@
     case AGERR:  // "wrong number of arguments" :
     case CODE_ERR:  // "goto is necessary" :
     case ILERR:  // "inline error" :
+    case SIERR:  // "non brace in struct init error" :
     return 0;
     }
     return 1;
@@ -366,6 +367,7 @@
 	(n==AGERR) ? "wrong number of arguments" :
 	(n==CODE_ERR) ? "goto is necessary" :
 	(n==ILERR) ? "inline error" :
+	(n==SIERR) ? "warning: missing braces around initializer" :
 	(n==CSERR) ? "no excutable code in switch" :
 	"Bug of compiler");
     errmsg();
@@ -1386,6 +1388,8 @@
 	    return offset;
 	}
 	checksym(RPAR);
+    } else {
+	error(SIERR);
     }
     mode=SFDINIT;
     while(1) {
@@ -1572,7 +1576,10 @@
 #endif
 	    offset=decl_data_field(t,n,offset);
 	conv->decl_data_end_(); conv->rc_();
-	if (lc) checksym(RC);
+	if (lc) {
+	    while (sym==COMMA) getsym(0);
+	    checksym(RC);
+	}
 	return offset;
     } 
     mode = mode_save;
--- a/mc.h	Sat Jan 07 12:46:38 2006 +0900
+++ b/mc.h	Sat Jan 07 13:09:45 2006 +0900
@@ -468,6 +468,7 @@
 #define AGERR   29
 #define ILERR   30
 #define CSERR   31
+#define SIERR   32
 
 /* error number end */
 
--- a/test/strinit.c	Sat Jan 07 12:46:38 2006 +0900
+++ b/test/strinit.c	Sat Jan 07 13:09:45 2006 +0900
@@ -41,6 +41,12 @@
 void
 linux_kernel();
 
+struct test{
+    int a,b,c;
+} huga = {
+    0,0,0,
+};
+
 int
 main()
 {
@@ -77,6 +83,8 @@
     printf("#0076:2: %d\n",temp12.m.k);
     printf("#0077:2: %d\n",temp12.m.j);
     printf("#0078:2: %d\n",temp11.c==(int)&b);
+    printf("#0068:2: %d\n",temp8.e);
+    printf("#0068:2: %d\n",temp6.e);
     linux_kernel();
     return 0;
 }
@@ -143,7 +151,7 @@
 
 
 static __inline__ __attribute__((always_inline)) __attribute__((always_inline)) 
-int ip_route_connect(/* struct rtable **rp, */ u32 dst,
+void ip_route_connect(/* struct rtable **rp, */ u32 dst,
                                    u32 src, u32 tos, int oif, u8 protocol,
                                    u16 sport, u16 dport /*, struct sock *sk */)
 {
@@ -160,7 +168,7 @@
 }
 
 static 
-int ip_route_connect0(/* struct rtable **rp, */ u32 dst,
+void ip_route_connect0(/* struct rtable **rp, */ u32 dst,
                                    u32 src, u32 tos, int oif, u8 protocol,
                                    u16 sport, u16 dport /*, struct sock *sk */)
 {