[tip: objtool/core] objtool: Change "warning:" to "error:" for --Werror

From: tip-bot2 for Josh Poimboeuf
Date: Mon Mar 17 2025 - 06:50:54 EST


The following commit has been merged into the objtool/core branch of tip:

Commit-ID: a307dd28b1c6655b67b2367663331034ac8da79c
Gitweb: https://git.kernel.org/tip/a307dd28b1c6655b67b2367663331034ac8da79c
Author: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
AuthorDate: Fri, 14 Mar 2025 12:29:09 -07:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Mon, 17 Mar 2025 11:36:02 +01:00

objtool: Change "warning:" to "error:" for --Werror

This is similar to GCC's behavior and makes it more obvious why the
build failed.

Suggested-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Reviewed-by: Brendan Jackman <jackmanb@xxxxxxxxxx>
Link: https://lore.kernel.org/r/56f0565b15b4b4caa9a08953fa9c679dfa973514.1741975349.git.jpoimboe@xxxxxxxxxx
---
tools/objtool/include/objtool/warn.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
index 6180288..e72b9d6 100644
--- a/tools/objtool/include/objtool/warn.h
+++ b/tools/objtool/include/objtool/warn.h
@@ -43,8 +43,10 @@ static inline char *offstr(struct section *sec, unsigned long offset)

#define WARN(format, ...) \
fprintf(stderr, \
- "%s: warning: objtool: " format "\n", \
- objname, ##__VA_ARGS__)
+ "%s: %s: objtool: " format "\n", \
+ objname, \
+ opts.werror ? "error" : "warning", \
+ ##__VA_ARGS__)

#define WARN_FUNC(format, sec, offset, ...) \
({ \