[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] accepting a wrong scruct declaration
From: |
Sergey Korshunoff |
Subject: |
Re: [Tinycc-devel] accepting a wrong scruct declaration |
Date: |
Mon, 30 Mar 2015 08:02:27 +0300 |
Hi! A code which must be patched
diff -urN tinycc.old/tccgen.c tinycc/tccgen.c
--- tinycc.old/tccgen.c 2015-03-29 11:04:47.000000000 +0300
+++ tinycc/tccgen.c 2015-03-30 07:36:05.000000000 +0300
@@ -2959,7 +2959,8 @@
type1 = btype;
if (tok != ':') {
type_decl(&type1, &ad, &v, TYPE_DIRECT |
TYPE_ABSTRACT);
- if (v == 0 && (type1.t & VT_BTYPE) != VT_STRUCT)
+// if (v == 0 && (type1.t & VT_BTYPE) != VT_STRUCT)
+ if (v == 0)
expect("identifier");
if (type_size(&type1, &align) < 0) {
if ((a == TOK_STRUCT) && (type1.t & VT_ARRAY) && c)
A rules:
- external anonymous struct must have identifer
- nested named struct must have identifier
But I can't express this rules in the code above. The code require
identifier in any case.