History

reject abstract declarators in function definition (Mauro Persano)

bellard committed 23 years ago

Commit 7b940fc1 parent 21d2d991 file · +7 −0Browse files

Unified · Split

tcc.c+7−0
@@ -8507,6 +8507,13 @@ static void decl(int l) · 8506 unmodified lines
85078507 error("cannot use local functions");
85088508 if (!(type.t & VT_FUNC))
85098509 expect("function definition");
8510+
8511+ /* reject abstract declarators in function definition */
8512+ sym = type.ref;
8513+ while ((sym = sym->next) != NULL)
8514+ if (!(sym->v & ~SYM_FIELD))
8515+ expect("identifier");
8516+
85108517 /* XXX: cannot do better now: convert extern line to static inline */
85118518 if ((type.t & (VT_EXTERN | VT_INLINE)) == (VT_EXTERN | VT_INLINE))
85128519 type.t = (type.t & ~VT_EXTERN) | VT_STATIC;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t