mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
reject abstract declarators in function definition (Mauro Persano)
This commit is contained in:
parent
21d2d99bdc
commit
7b940fcb1b
7
tcc.c
7
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;
|
||||
|
Loading…
Reference in New Issue
Block a user