changeset 281:a1fe281cc571

[project @ 2003-07-20 12:40:53 by bellard] reject abstract declarators in function definition (Mauro Persano)
author bellard
date Sun, 20 Jul 2003 12:40:53 +0000
parents 86ca0d3ce28b
children 950acf85e8ac
files tcc.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Mon Jun 02 20:32:30 2003 +0000
+++ b/tcc.c	Sun Jul 20 12:40:53 2003 +0000
@@ -8507,6 +8507,13 @@
                     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;