aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorbellard <bellard>2003-04-13 14:03:18 +0000
committerbellard <bellard>2003-04-13 14:03:18 +0000
commiteed54d6bfb9cff942d5d79ca99ae3dc2382d0b9c (patch)
tree9543b8a949c09c3dec4d6947c33b990c79b6fe3a /tcc.c
parent3605c50b36bd9985ea31bcf609db636912906918 (diff)
downloadtinycc-eed54d6bfb9cff942d5d79ca99ae3dc2382d0b9c.tar.gz
tinycc-eed54d6bfb9cff942d5d79ca99ae3dc2382d0b9c.tar.bz2
struct syntax fix
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tcc.c b/tcc.c
index 012dc3e..d5e3b79 100644
--- a/tcc.c
+++ b/tcc.c
@@ -1523,7 +1523,7 @@ static Sym *sym_find2(Sym *s, int v)
}
/* structure lookup */
-static Sym *struct_find(int v)
+static inline Sym *struct_find(int v)
{
v -= TOK_IDENT;
if ((unsigned)v >= (unsigned)(tok_ident - TOK_IDENT))
@@ -5843,7 +5843,8 @@ static void struct_decl(CType *type, int u)
v = tok;
next();
/* struct already defined ? return it */
- /* XXX: check consistency */
+ if (v < TOK_IDENT)
+ expect("struct/union/enum name");
s = struct_find(v);
if (s) {
if (s->type.t != a)