From cc1b64e992b52d19b24cdc7677fc451c60d2c9d4 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 30 Mar 2022 23:20:39 -0400 Subject: [PATCH] Flush standard output before popping assertions Seeing error messages before we die generally makes assertions easier to debug. Signed-off-by: Kent Overstreet --- include/linux/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index 77260f3..957d408 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -17,7 +17,7 @@ #define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2*!!(cond)])) -#define BUG() do { assert(0); unreachable(); } while (0) +#define BUG() do { fflush(stdout); assert(0); unreachable(); } while (0) #define BUG_ON(cond) assert(!(cond)) #define WARN(cond, fmt, ...) \ -- 2.39.2