[PATCH 3/4] define __LONG_MAX__ & __SIZEOF_POINTER__

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

 



They're part of GCC's common predefined macros and some
code & header files depends on them.

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

diff --git a/lib.c b/lib.c
index 018fa145e..2a1bbac87 100644
--- a/lib.c
+++ b/lib.c
@@ -804,7 +804,13 @@ static char **handle_switch(char *arg, char **next)
 
 static void predefined_macros(void)
 {
+	unsigned long long val;
+
 	add_pre_buffer("#define __CHECKER__ 1\n");
+
+	val = (1ULL << (bits_in_long-1)) - 1;
+	add_pre_buffer("#weak_define __LONG_MAX__ %#llxLL\n", val);
+	add_pre_buffer("#weak_define __SIZEOF_POINTER__ %d\n", bits_in_pointer/8);
 }
 
 void declare_builtin_functions(void)
-- 
2.11.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