diff --git a/tccgen.c b/tccgen.c
index aa9be34..46d16bd 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -7039,6 +7039,8 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c,
 		if (tok == '}')
 		    break;
 		skip(',');
+		if (tok == ',')
+		    tcc_error("unexpected ','");
 	    }
         }
         /* put zeros at the end */
