History

Add warning For example: struct A { int b []; };

jiang committed 12 years ago

Commit 14d0aa41 parent 0f51ccd1 file · +2 −0Browse files

Unified · Split

tccgen.c+2−0
@@ -3030,6 +3030,8 @@ static void struct_decl(CType *type, int u, int tdef) · 3029 unmodified lines
30303030 skip(';');
30313031 }
30323032 skip('}');
3033+ if (!c && flexible)
3034+ tcc_error("flexible array member '%s' in otherwise empty struct", get_tok_str(v, NULL));
30333035 /* store size and alignment */
30343036 s->c = (c + maxalign - 1) & -maxalign;
30353037 s->r = maxalign;

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