From 7b940fcb1b1ae5407c09ae03bbcafc32447e720c Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 20 Jul 2003 12:40:53 +0000 Subject: [PATCH] reject abstract declarators in function definition (Mauro Persano) --- tcc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tcc.c b/tcc.c index 3da2068f..7ad5ce31 100644 --- a/tcc.c +++ b/tcc.c @@ -8507,6 +8507,13 @@ static void decl(int l) error("cannot use local functions"); if (!(type.t & VT_FUNC)) expect("function definition"); + + /* reject abstract declarators in function definition */ + sym = type.ref; + while ((sym = sym->next) != NULL) + if (!(sym->v & ~SYM_FIELD)) + expect("identifier"); + /* XXX: cannot do better now: convert extern line to static inline */ if ((type.t & (VT_EXTERN | VT_INLINE)) == (VT_EXTERN | VT_INLINE)) type.t = (type.t & ~VT_EXTERN) | VT_STATIC; -- 2.11.4.GIT