Forbid the use of array of functions

Prevent the following code from compiling:

int (*fct)[42](int x);

Reported-by: Abdul Wadud Mohammad Mohibur Rashid <mohibur_rashid@yahoo.com>
master
Thomas Preud'homme 2013-09-19 18:58:46 +02:00
parent 642b6d0f50
commit a465b7f58f
1 changed files with 2 additions and 0 deletions

View File

@ -3278,6 +3278,8 @@ static void post_type(CType *type, AttributeDef *ad)
skip(']');
/* parse next post type */
post_type(type, ad);
if (type->t == VT_FUNC)
tcc_error("declaration of an array of functions");
t1 |= type->t & VT_VLA;
if (t1 & VT_VLA) {