libsel4debug: Guard functions using cap identify The cap identification function only exists on builds when the kernel is in debug mode. In release, this function doesn't exist and the compiler raises warnings. This commit adds the preprocessor guards to avoid compiling these functions when the cap identification function doesn't exist. Signed-off-by: Damon Lee <Damon.Lee@data61.csiro.au>
diff --git a/libsel4debug/include/sel4debug/debug.h b/libsel4debug/include/sel4debug/debug.h index 8803f8b..ad0f2bc 100644 --- a/libsel4debug/include/sel4debug/debug.h +++ b/libsel4debug/include/sel4debug/debug.h
@@ -21,6 +21,7 @@ void debug_cap_identify(seL4_CPtr cap); +#ifdef CONFIG_DEBUG_BUILD static inline int debug_cap_is_valid(seL4_CPtr cap) { return (0 != seL4_DebugCapIdentify(cap)); @@ -39,7 +40,7 @@ // cap_notification_cap = 6, but we can't include it here return (6 == seL4_DebugCapIdentify(cap)); } - +#endif /* CONFIG_DEBUG_BUILD */ void debug_print_bootinfo(seL4_BootInfo *info);