From 0f522fb32a635dafce30f3ce3ff2cb15bcec809e Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 20 Sep 2013 01:06:43 +0200 Subject: [PATCH] Forbid enum redefinition. Prevent the following code from compiling: enum color {RED, GREEN, BLUE}; enum color {R, G, B}; int main() { return R; } Reported-by: John Haque --- tccgen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tccgen.c b/tccgen.c index 33c42de8..53a2b6b4 100644 --- a/tccgen.c +++ b/tccgen.c @@ -2801,6 +2801,7 @@ static void struct_decl(CType *type, int u) if (tok == '}') break; } + s->c = type_size(&int_type, &align); skip('}'); } else { maxalign = 1;