mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Move type checks before bit-field width parsing
This commit is contained in:
parent
aaa0cf5448
commit
fb9b50ff9c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user