    fix the bug #XXXXX
    - a warning: unnamed struct/union that defines no instances
    - allow a nested named struct declaration w/o identifier
      only when option -fms-extensions is used

diff -urN tinycc.old/libtcc.c tinycc/libtcc.c
--- tinycc.old/libtcc.c	2015-04-02 15:14:17.000000000 +0300
+++ tinycc/libtcc.c	2015-04-02 17:45:32.000000000 +0300
@@ -1463,6 +1463,7 @@
     { offsetof(TCCState, char_is_unsigned), FD_INVERT, "signed-char" },
     { offsetof(TCCState, nocommon), FD_INVERT, "common" },
     { offsetof(TCCState, leading_underscore), 0, "leading-underscore" },
+    { offsetof(TCCState, ms_extensions), 0, "ms-extensions" },
 };
 
 /* set/reset a flag */
diff -urN tinycc.old/tcc-doc.texi tinycc/tcc-doc.texi
--- tinycc.old/tcc-doc.texi	2015-04-02 15:14:17.000000000 +0300
+++ tinycc/tcc-doc.texi	2015-04-02 17:59:39.000000000 +0300
@@ -236,6 +236,11 @@
 @item -fleading-underscore
 Add a leading underscore at the beginning of each C symbol.
 
+@item -fms-extensions
+Allow a MS C compiler extensions to the language. Curretly this
+assume a nested named structure declaration without identifier behave
+like an unnamed one.
+
 @end table
 
 Warning options:
diff -urN tinycc.old/tccgen.c tinycc/tccgen.c
--- tinycc.old/tccgen.c	2015-04-02 15:14:17.000000000 +0300
+++ tinycc/tccgen.c	2015-04-02 17:50:33.000000000 +0300
@@ -2959,8 +2959,17 @@
                     type1 = btype;
                     if (tok != ':') {
                         type_decl(&type1, &ad, &v, TYPE_DIRECT | TYPE_ABSTRACT);
-                        if (v == 0 && (type1.t & VT_BTYPE) != VT_STRUCT)
-                            expect("identifier");
+                        if (v == 0) {
+                    	    if ((type1.t & VT_BTYPE) != VT_STRUCT)
+                        	expect("identifier");
+                    	    else {
+				int v = btype.ref->v;
+				if (!(v & SYM_FIELD) && (v & ~SYM_STRUCT) < SYM_FIRST_ANOM) {
+				    if (tcc_state->ms_extensions == 0)
+                        		expect("identifier");
+				}
+                    	    }
+                        }
                         if (type_size(&type1, &align) < 0) {
 			    if ((a == TOK_STRUCT) && (type1.t & VT_ARRAY) && c)
 			        flexible = 1;
@@ -6121,7 +6130,11 @@
         if (((btype.t & VT_BTYPE) == VT_ENUM ||
              (btype.t & VT_BTYPE) == VT_STRUCT) && 
             tok == ';') {
-            /* we accept no variable after */
+	    if ((btype.t & VT_BTYPE) == VT_STRUCT) {
+		int v = btype.ref->v;
+		if (!(v & SYM_FIELD) && (v & ~SYM_STRUCT) >= SYM_FIRST_ANOM)
+        	    tcc_warning("unnamed struct/union that defines no instances");
+	    }
             next();
             continue;
         }
diff -urN tinycc.old/tcc.h tinycc/tcc.h
--- tinycc.old/tcc.h	2015-04-02 15:14:17.000000000 +0300
+++ tinycc/tcc.h	2015-04-02 17:41:57.000000000 +0300
@@ -602,6 +602,7 @@
     /* C language options */
     int char_is_unsigned;
     int leading_underscore;
+    int ms_extensions;		/* allow nested named struct w/o identifier behave like unnamed */
     
     /* warning switches */
     int warn_write_strings;
