[PATCH 01/12] doc: is_int_type() returns false for SYM_RESTRICTs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It isn't at all obvious that is_int_type() return false for
restricted/bitwise types. It's even quite counter-intuitive.

So document this.

Note: Fortunately, there isn't a lot of callers and the main
      callers are all in parse.c and are OK. OTOH, the callers
      in sparse-llvm.c are wrong and need another helper.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 symbol.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/symbol.h b/symbol.h
index 81c185eed..5a3d7cef5 100644
--- a/symbol.h
+++ b/symbol.h
@@ -335,6 +335,11 @@ static inline struct symbol *get_base_type(const struct symbol *sym)
 	return examine_symbol_type(sym->ctype.base_type);
 }
 
+///
+// test if type is an integer type
+//
+// @return: ``1`` for plain integer type, enums & bitfields
+//	but ``0`` for bitwise types!
 static inline int is_int_type(const struct symbol *type)
 {
 	if (type->type == SYM_NODE)
-- 
2.18.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux