diff --git a/src/cc65/declare.c b/src/cc65/declare.c index b8ad09cfd..5c5c5c01e 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -688,16 +688,16 @@ static int ParseFieldWidth (Declaration* Decl) return -1; } - /* Read the width */ - NextToken (); - ConstAbsIntExpr (hie1, &Expr); - if (SizeOf (Decl->Type) != SizeOf (type_uint)) { /* Only int sized types may be used for bit-fields for now */ Error ("cc65 currently only supports unsigned int bit-fields"); return -1; } + /* Read the width */ + NextToken (); + ConstAbsIntExpr (hie1, &Expr); + if (Expr.IVal < 0) { Error ("Negative width in bit-field"); return -1;