scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 693f45dbf91d15d6927af43f53b254a7d243e71e
parent 202a1a41c373981049dbb183f03a3179c3c04f5c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 28 Feb 2018 12:30:30 +0000

[cc1] Don't allow redifinition of typedef

Redifinition of typedef is a new feature added in C11, and since
scc is a c99 compiler it must be an error.

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

diff --git a/cc1/decl.c b/cc1/decl.c @@ -203,6 +203,8 @@ redcl(Symbol *sym, Type *tp, int sclass) name); break; case TYPEDEF: + /* Only C11 allows multiple definitions of a typedef. */ + goto redeclaration; case EXTERN: break; case STATIC: