diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-02-07 21:04:24 +0100 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2017-02-13 09:34:46 +0800 |
| commit | 8d688c9a6ee220ce00b30afd8bdffa34434c9950 (patch) | |
| tree | c534fcf44389939701f37396c5060a4789251b73 | |
| parent | af67375f340c29ba481c29a2cdda49d68db85d53 (diff) | |
| download | sparse-dev-8d688c9a6ee220ce00b30afd8bdffa34434c9950.tar.gz | |
define __LONG_MAX__ & __SIZEOF_POINTER__
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@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
| -rw-r--r-- | lib.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -802,7 +802,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) |
