This is slightly shorter (and thus may avoid long lines) and facilitate the introduction of MOD_RETRICT in a later patch. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- evaluate.c | 2 +- expand.c | 2 +- parse.c | 2 +- symbol.h | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/evaluate.c b/evaluate.c index cf3cf244d..cfe53f747 100644 --- a/evaluate.c +++ b/evaluate.c @@ -627,7 +627,7 @@ static struct symbol *evaluate_ptr_add(struct expression *expr, struct symbol *i static void examine_fn_arguments(struct symbol *fn); -#define MOD_IGN (MOD_VOLATILE | MOD_CONST | MOD_PURE) +#define MOD_IGN (MOD_QUALIFIER | MOD_PURE) const char *type_difference(struct ctype *c1, struct ctype *c2, unsigned long mod1, unsigned long mod2) diff --git a/expand.c b/expand.c index 5f908c971..60986b3ff 100644 --- a/expand.c +++ b/expand.c @@ -478,7 +478,7 @@ static int expand_comma(struct expression *expr) return cost; } -#define MOD_IGN (MOD_VOLATILE | MOD_CONST) +#define MOD_IGN (MOD_QUALIFIER) static int compare_types(int op, struct symbol *left, struct symbol *right) { diff --git a/parse.c b/parse.c index e7e112847..c6dccfbd8 100644 --- a/parse.c +++ b/parse.c @@ -2184,7 +2184,7 @@ static struct statement *start_function(struct symbol *sym) start_function_scope(); ret = alloc_symbol(sym->pos, SYM_NODE); ret->ctype = sym->ctype.base_type->ctype; - ret->ctype.modifiers &= ~(MOD_STORAGE | MOD_CONST | MOD_VOLATILE | MOD_TLS | MOD_ADDRESSABLE | MOD_NOCAST | MOD_NODEREF); + ret->ctype.modifiers &= ~(MOD_STORAGE | MOD_QUALIFIER | MOD_TLS | MOD_ADDRESSABLE | MOD_NOCAST | MOD_NODEREF); ret->ctype.modifiers |= (MOD_AUTO | MOD_REGISTER); bind_symbol(ret, &return_ident, NS_ITERATOR); stmt->ret = ret; diff --git a/symbol.h b/symbol.h index d33afc97d..994a11a7f 100644 --- a/symbol.h +++ b/symbol.h @@ -242,9 +242,10 @@ struct symbol { #define MOD_SIZE (MOD_CHAR | MOD_SHORT | MOD_LONG_ALL) #define MOD_IGNORE (MOD_STORAGE | MOD_ADDRESSABLE | \ MOD_ASSIGNED | MOD_USERTYPE | MOD_EXPLICITLY_SIGNED) -#define MOD_PTRINHERIT (MOD_VOLATILE | MOD_CONST | MOD_NODEREF | MOD_NORETURN | MOD_NOCAST) +#define MOD_QUALIFIER (MOD_CONST | MOD_VOLATILE) +#define MOD_PTRINHERIT (MOD_QUALIFIER | MOD_NODEREF | MOD_NORETURN | MOD_NOCAST) /* modifiers preserved by typeof() operator */ -#define MOD_TYPEOF (MOD_VOLATILE | MOD_CONST | MOD_NOCAST | MOD_SPECIFIER) +#define MOD_TYPEOF (MOD_QUALIFIER | MOD_NOCAST | MOD_SPECIFIER) /* Current parsing/evaluation function */ -- 2.14.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html