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
32783278 skip(']');
32793279 /* parse next post type */
32803280 post_type(type, ad);
3281+ if (type->t == VT_FUNC)
3282+ tcc_error("declaration of an array of functions");
32813283 t1 |= type->t & VT_VLA;
32823284
32833285 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