[PATCH 11/13] objtool: Change "warning:" to "error:" for --Werror

Josh Poimboeuf posted 13 patches 9 months, 1 week ago
[PATCH 11/13] objtool: Change "warning:" to "error:" for --Werror
Posted by Josh Poimboeuf 9 months, 1 week ago
This is similar to GCC's behavior and makes it more obvious why the
build failed.

Suggested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 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 6180288927fd..e72b9d630551 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, ...)		\
 ({							\
-- 
2.48.1
Re: [PATCH 11/13] objtool: Change "warning:" to "error:" for --Werror
Posted by Miroslav Benes 9 months ago
On Fri, 14 Mar 2025, Josh Poimboeuf wrote:

> This is similar to GCC's behavior and makes it more obvious why the
> build failed.
> 
> Suggested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Reviewed-by: Miroslav Benes <mbenes@suse.cz>

M
Re: [PATCH 11/13] objtool: Change "warning:" to "error:" for --Werror
Posted by Brendan Jackman 9 months ago
On Fri, Mar 14, 2025 at 12:29:09PM -0700, Josh Poimboeuf wrote:
> This is similar to GCC's behavior and makes it more obvious why the
> build failed.
> 
> Suggested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Reviewed-by: Brendan Jackman <jackmanb@google.com>