T_QUAL_NONE = 0x0000,
T_QUAL_CONST = 0x1000,
T_QUAL_VOLATILE = 0x2000,
- T_MASK_QUAL = 0x3000,
+ T_QUAL_RESTRICT = 0x4000,
+ T_MASK_QUAL = 0x7000,
/* Types */
T_CHAR = T_TYPE_CHAR | T_CLASS_INT | T_SIGN_UNSIGNED | T_SIZE_NONE,
Q |= T_QUAL_VOLATILE;
break;
+ case TOK_RESTRICT:
+ if (Q & T_QUAL_RESTRICT) {
+ Error ("Duplicate qualifier: `restrict'");
+ }
+ Q |= T_QUAL_RESTRICT;
+ break;
+
default:
Internal ("Unexpected type qualifier token: %d", CurTok.Tok);
Error ("Preprocessor expression expected");
ED_MakeConstAbsInt (E, 1);
return;
- }
+ }
switch (CurTok.Tok) {
/* All operators that call this function expect an int on the lhs */
if (!IsClassInt (Expr->Type)) {
Error ("Integer expression expected");
+ /* To avoid further errors, make Expr a valid int expression */
+ ED_MakeConstAbsInt (Expr, 1);
}
/* Remember the operator token, then skip it */
TOK_AUTO,
TOK_EXTERN,
TOK_REGISTER,
- TOK_RESTRICT,
TOK_STATIC,
TOK_TYPEDEF,
TOK_FIRST_TYPEQUAL,
TOK_CONST = TOK_FIRST_TYPEQUAL,
TOK_VOLATILE,
- TOK_LAST_TYPEQUAL = TOK_VOLATILE,
+ TOK_RESTRICT,
+ TOK_LAST_TYPEQUAL = TOK_RESTRICT,
/* Tokens denoting types */
TOK_FIRST_TYPE,