diff mbox

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

Message ID 20170817040529.7289-9-luc.vanoostenryck@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Luc Van Oostenryck Aug. 17, 2017, 4:05 a.m. UTC
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@gmail.com>
---
 symbol.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

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;