History

Forbid the use of array of functions

Prevent the following code from compiling: int (*fct)[42](int x);

Thomas Preud'homme committed 13 years ago

Commit a465b7f1 parent 642b6d01 file · +2 −0Browse files

Unified · Split

tccgen.c+2−0
@@ -3278,6 +3278,8 @@ static void post_type(CType *type, AttributeDef *ad) · 3277 unmodified lines
3278 skip(']');3278 skip(']');
3279 /* parse next post type */3279 /* parse next post type */
3280 post_type(type, ad);3280 post_type(type, ad);
3281 if (type->t == VT_FUNC)
3282 tcc_error("declaration of an array of functions");
3281 t1 |= type->t & VT_VLA;3283 t1 |= type->t & VT_VLA;
3282 3284
3283 if (t1 & VT_VLA) {3285 if (t1 & VT_VLA) {

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