[PATCH 12/20] 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 integers to/from pointers, we would like to have
an integer type which has the same size as a pointer.

Currently, it's always the 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 6d23503f8..6b891edd6 100644
--- a/symbol.h
+++ b/symbol.h
@@ -278,6 +278,9 @@ extern struct symbol	float128_ctype;
 extern struct symbol	const_void_ctype, const_char_ctype;
 extern struct symbol	const_ptr_ctype, const_string_ctype;
 
+#define	uintptr_ctype	 size_t_ctype
+#define	 intptr_ctype	ssize_t_ctype
+
 /* Special internal symbols */
 extern struct symbol	zero_int;
 
-- 
2.17.1

--
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