[RFC PATCH 08/14] cast: make [u]intptr_ctype alias of [s]size_t_ctype

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

 



When processing integer to/from pointers, we would like to have
an integer type which has the same size as a pointer.

Currently, it's always th case for [s]size_t but it's preferable
to have a specific type which will always offer this guarantee,
like [u]intptr_t.

Fix this lazily by defining [u]intptr_ctype to [s]size_t_ctype.

Note: this intptr_t is just internal to sparse and can be different
      from the type choosen by the libc/platform.

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

diff --git a/symbol.h b/symbol.h
index 327449611..3e343e41e 100644
--- a/symbol.h
+++ b/symbol.h
@@ -270,6 +270,9 @@ extern struct symbol	bool_ctype, void_ctype, type_ctype,
 			incomplete_ctype, label_ctype, bad_ctype,
 			null_ctype;
 
+#define	uintptr_ctype	 size_t_ctype
+#define	 intptr_ctype	ssize_t_ctype
+
 /* Special internal symbols */
 extern struct symbol	zero_int;
 
-- 
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



[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