diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-09-24 21:52:39 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-01 00:44:54 +0200 |
commit | 58721d6e25e1845ce147150755e61401fcbc1a32 (patch) | |
tree | ece4a0dbb21a3a5e98087b7034200dc0221a3a35 | |
parent | bf3144077b3d4284d9ba3cbb62e22e23fb1d0a51 (diff) | |
download | sparse-58721d6e25e1845ce147150755e61401fcbc1a32.tar.gz |
flex-array: add helper has_flexible_array()
This will make later checks easier & clearer.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | symbol.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -507,6 +507,13 @@ static inline int is_extern_inline(struct symbol *sym) is_function(sym->ctype.base_type); } +static inline int has_flexible_array(struct symbol *type) +{ + if (type->type == SYM_NODE) + type = type->ctype.base_type; + return type->has_flex_array; +} + static inline int get_sym_type(struct symbol *type) { if (type->type == SYM_NODE) |