Relieve callers from having to suffix their messages with a newline escape sequence, have the macro append it to the format string instead. This is mostly a fix for (the many) calls to BUG() without a newline suffix but causes an extra new line in (equally many) others. Fixing them is subject to followup patch. Signed-off-by: Phil Sutter --- include/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/utils.h b/include/utils.h index 0db0cf20e493c..f47e7eb8d8093 100644 --- a/include/utils.h +++ b/include/utils.h @@ -45,7 +45,7 @@ #define __must_check __attribute__((warn_unused_result)) #define __noreturn __attribute__((__noreturn__)) -#define BUG(fmt, arg...) ({ fprintf(stderr, "BUG: " fmt, ##arg); assert(0); abort(); }) +#define BUG(fmt, arg...) ({ fprintf(stderr, "BUG: " fmt "\n", ##arg); assert(0); abort(); }) #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) -- 2.51.0