From e477e12ade9544c31779f007faee169aae22e145 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 9 Dec 2022 12:51:00 -0500 Subject: config: New BFS_UNINIT() macro for intentionally uninitialized variables --- src/config.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h index 229f593..810f913 100644 --- a/src/config.h +++ b/src/config.h @@ -213,4 +213,13 @@ # define BFS_UNSUPPRESS() #endif +/** + * Initialize a variable, unless sanitizers would detect uninitialized uses. + */ +#if __has_feature(memory_sanitizer) +# define BFS_UNINIT(var, value) var = var +#else +# define BFS_UNINIT(var, value) var = value +#endif + #endif // BFS_CONFIG_H -- cgit v1.2.3