diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-15 11:41:52 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-15 20:41:46 +0100 |
commit | e0d40e809a6ffd7630ab058df7b0ad08a8d355e2 (patch) | |
tree | ba218c3801cd78832d8bdfa63a8a09e43abc4540 | |
parent | f8255903ad142da2bd0a19f5313d25f4f96b8452 (diff) | |
download | sparse-e0d40e809a6ffd7630ab058df7b0ad08a8d355e2.tar.gz |
typeof: avoid using is_bitfield_type()
is_bitfield_type() is one of the few type-testing helper
based on get_sym_type(). But get_sym_type() test for SYM_NODE
and SYM_ENUM, which is not needed here.
So, simply test for SYM_BITFIELD.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | symbol.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -460,12 +460,12 @@ static struct symbol *examine_typeof(struct symbol *sym) if (!base) base = &bad_ctype; - if (is_bitfield_type(base)) - warning(base->pos, "typeof applied to bitfield type"); if (base->type == SYM_NODE) { mod |= base->ctype.modifiers & MOD_TYPEOF; base = base->ctype.base_type; } + if (base->type == SYM_BITFIELD) + warning(base->pos, "typeof applied to bitfield type"); sym->type = SYM_NODE; sym->ctype.modifiers = mod; sym->ctype.base_type = base; |