Index: /trunk/processor/main.m4
===================================================================
--- /trunk/processor/main.m4	(revision 715)
+++ /trunk/processor/main.m4	(revision 719)
@@ -206,10 +206,23 @@
 dnl }}}
 dnl {{{ DONE_*
-define(`DONE_SIZE', `IFASSERT(`
+define(`DONE_SIZE', `IFASSERT(`dnl
 	done_size += $1`';
 	done_count ++;
 ')')
 define(`DONE', `
-	define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,$1')
+	define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,"$1"')
+	IFASSERT(`dnl
+		if (zend_hash_exists(&done_names, "$1", sizeof("$1"))) {
+			fprintf(stderr
+				, "duplicate field at %s `#'%d FUNC_NAME`' : %s\n"
+				, __FILE__, __LINE__
+				, "$1"
+				);
+		}
+		else {
+			zend_uchar b = 1;
+			zend_hash_add(&done_names, "$1", sizeof("$1"), (void*)&b, sizeof(b), NULL);
+		}
+	')
 	DONE_SIZE(`sizeof(src->$1)')
 ')
Index: /trunk/processor/struct.m4
===================================================================
--- /trunk/processor/struct.m4	(revision 662)
+++ /trunk/processor/struct.m4	(revision 719)
@@ -30,9 +30,8 @@
 	{
 		pushdef(`ELEMENTS_DONE')
-		ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')define(`SIZEOF_$1', 0)')
 		IFASSERT(`
 			/* {{{ init assert */
-			ifdef(`SIZEOF_$1', , `m4_errprint(`missing SIZEOF_$1, safe to ignore')define(`SIZEOF_$1', 0)')
-			ifdef(`COUNTOF_$1', , `m4_errprint(`missing COUNTOF_$1, safe to ignore')define(`COUNTOF_$1', 0)')
+			ifdef(`SIZEOF_$1', , `m4_errprint(`missing SIZEOF_$1, safe to ignore')')
+			ifdef(`COUNTOF_$1', , `m4_errprint(`missing COUNTOF_$1, safe to ignore'))')
 			dnl SIZEOF_x COUNTOF_x can be both defined or both not
 			ifdef(`SIZEOF_$1', `
@@ -48,4 +47,7 @@
 			int assert_size = SIZEOF_$1, assert_count = COUNTOF_$1;
 			int done_size = 0, done_count = 0;
+			const char *assert_names[] = { ifdef(`ELEMENTSOF_$1', `ELEMENTSOF_$1') };
+			HashTable done_names;
+			zend_hash_init(&done_names, 0, NULL, NULL, 0);
 			/* }}} */
 			IFRESTORE(`assert(xc_is_shm(src));')
@@ -53,4 +55,5 @@
 			do {
 		')
+		ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')')
 
 		ifdef(`USEMEMCPY', `IFCOPY(`
@@ -68,7 +71,15 @@
 			INDENT()fprintf(stderr, "}\n");
 		')
-		ifdef(`SKIPASSERT_ONCE', `undefine(`SKIPASSERT_ONCE')', `
+		ifdef(`SKIPASSERT_ONCE', `
+			undefine(`SKIPASSERT_ONCE')
 			IFASSERT(`
-				/* {{{ check assert */
+				zend_hash_destroy(&done_names);
+			')
+		', `
+			IFASSERT(`
+			/* {{{ check assert */ do {
+				int name_check_errors = xc_check_names(__FILE__, __LINE__, "FUNC_NAME", assert_names, sizeof(assert_names) / sizeof(assert_names[0]), &done_names);
+				zend_hash_destroy(&done_names);
+
 				if (done_count != assert_count) {
 					fprintf(stderr
@@ -85,8 +96,8 @@
 						);
 				}
-				if (done_count != assert_count || done_size != assert_size) {
+				if (name_check_errors || done_count != assert_count || done_size != assert_size) {
 					assert(0);
 				}
-				/* }}} */
+			} while (0); /* }}} */
 			')
 			ifdef(`ELEMENTSOF_$1', `
Index: /trunk/processor/head.m4
===================================================================
--- /trunk/processor/head.m4	(revision 690)
+++ /trunk/processor/head.m4	(revision 719)
@@ -306,4 +306,47 @@
 }
 /* }}} */
+/* {{{ field name checker */
+IFASSERT(`dnl
+int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, int assert_names_count, HashTable *done_names)
+{
+	int errors = 0;
+	if (assert_names_count) {
+		int i;
+		Bucket *b;
+
+		for (i = 0; i < assert_names_count; ++i) {
+			if (!zend_hash_exists(done_names, assert_names[i], strlen(assert_names[i]) + 1)) {
+				fprintf(stderr
+					, "missing field at %s `#'%d %s`' : %s\n"
+					, file, line, functionName
+					, assert_names[i]
+					);
+				++errors;
+			}
+		}
+
+		for (b = done_names->pListHead; b != NULL; b = b->pListNext) {
+			int known = 0;
+			int i;
+			for (i = 0; i < assert_names_count; ++i) {
+				if (strcmp(assert_names[i], BUCKET_KEY_S(b)) == 0) {
+					known = 1;
+					break;
+				}
+			}
+			if (!known) {
+				fprintf(stderr
+					, "unknown field at %s `#'%d %s`' : %s\n"
+					, file, line, functionName
+					, BUCKET_KEY_S(b)
+					);
+				++errors;
+			}
+		}
+	}
+	return errors;
+}
+')
+/* }}} */
 dnl ================ export API
 define(`DEFINE_STORE_API', `
Index: /trunk/mkstructinfo.awk
===================================================================
--- /trunk/mkstructinfo.awk	(revision 393)
+++ /trunk/mkstructinfo.awk	(revision 719)
@@ -50,8 +50,8 @@
 
 			if (i == 0) {
-				elms = buffer[i];
+				elms = "\"" buffer[i] "\"";
 			}
 			else {
-				elms = elms "," buffer[i];
+				elms = elms "," "\"" buffer[i] "\"";
 			}
 		}
