diff mbox series

[3/3] kbuild: rust: support `W=e` for Rust

Message ID 20240519211235.589325-3-ojeda@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/3] kbuild: rust: move `-Dwarnings` handling to `Makefile.extrawarn` | expand

Commit Message

Miguel Ojeda May 19, 2024, 9:12 p.m. UTC
With `W=e`, kernel C targets error out on warnings.

Add support for the same feature for Rust code, but take the opportunity
to apply it for every Rust target (i.e. not just kernel code), so that
it behaves like having set `CONFIG_WERROR`.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 scripts/Makefile.extrawarn | 1 +
 1 file changed, 1 insertion(+)

Comments

Alice Ryhl May 20, 2024, 9:44 a.m. UTC | #1
On Sun, May 19, 2024 at 11:13 PM Miguel Ojeda <ojeda@kernel.org> wrote:
>
> With `W=e`, kernel C targets error out on warnings.
>
> Add support for the same feature for Rust code, but take the opportunity
> to apply it for every Rust target (i.e. not just kernel code), so that
> it behaves like having set `CONFIG_WERROR`.
>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
diff mbox series

Patch

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 990890821889..214b5edce4f2 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -206,5 +206,6 @@  endif
 ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),)
 
 KBUILD_CFLAGS += -Werror
+rust_common_flags += -Dwarnings
 
 endif