scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 248d4be51443e4c1a6137f285bdde1a027120bb6
parent 0e120abe46b29d6c3f3d00d6fda467a3f8949d37
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 27 Aug 2015 16:07:25 +0200

Disallow sizeof of incomplete type

Diffstat:
cc1/expr.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc1/expr.c b/cc1/expr.c @@ -961,6 +961,8 @@ unary(void) case SIZEOF: next(); tp = (yytoken == '(') ? sizeexp() : typeof(unary()); + if (!tp->defined) + errorp("sizeof applied to an incomplete type"); return sizeofnode(tp); case INC: case DEC: