oracle / bpftune

bpftune uses BPF to auto-tune Linux systems
Other
659 stars 56 forks source link

NULL isn't a number #20

Closed pavlinux closed 1 year ago

pavlinux commented 1 year ago

https://github.com/oracle-samples/bpftune/blob/bbcb0c662bc9c84fcabc7d7adc631f34c241054a/include/bpftune/bpftune.bpf.h#L35

https://lwn.net/Articles/93577/ :)

index 8821cf2..b90b70e 100644
--- a/include/bpftune/bpftune.bpf.h
+++ b/include/bpftune/bpftune.bpf.h
@@ -32,7 +32,7 @@
 extern __u32 LINUX_KERNEL_VERSION __kconfig;

 #ifndef NULL
-#define    NULL    (0)
+#define    NULL    ((void *) 0)
 #endif

 #define STATIC_ASSERT(x, msg)  _Static_assert(x, msg)
alan-maguire commented 1 year ago

ugh, thanks! I'll fix and attribute it to you

alan-maguire commented 1 year ago

fixed by https://github.com/oracle-samples/bpftune/pull/22