@@ -6,7 +6,7 @@ always-$(CONFIG_RUST) += exports_core_generated.h
66# Missing prototypes are expected in the helpers since these are exported
77# for Rust only, thus there is no header nor prototypes.
88obj-$(CONFIG_RUST) += helpers.o
9- CFLAGS_REMOVE_helpers.o = -Wmissing-prototypes
9+ CFLAGS_REMOVE_helpers.o = -Wmissing-prototypes -Wmissing-declarations
1010
1111always-$(CONFIG_RUST) += libmacros.so
1212no-clean-files += libmacros.so
@@ -269,11 +269,14 @@ $(objtree)/rust/bindings_generated.rs: $(srctree)/rust/kernel/bindings_helper.h
269269 $(srctree)/rust/bindgen_parameters FORCE
270270 $(call if_changed_dep,bindgen)
271271
272- # See `CFLAGS_REMOVE_helpers.o` above for `-Wno-missing-prototypes`.
272+ # See `CFLAGS_REMOVE_helpers.o` above. In addition, Clang on C does not warn
273+ # with `-Wmissing-declarations` (unlike GCC), so it is not strictly needed here
274+ # given it is `libclang`; but for consistency, future Clang changes and/or
275+ # a potential future GCC backend for `bindgen`, we disable it too.
273276$(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_flags = \
274277 --blacklist-type '.*' --whitelist-var '' --whitelist-function 'rust_helper_.*'
275278$(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_cflags = \
276- -I$(objtree)/rust/ -Wno-missing-prototypes
279+ -I$(objtree)/rust/ -Wno-missing-prototypes -Wno-missing-declarations
277280$(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_extra = ; \
278281 sed -Ei 's/pub fn rust_helper_([a-zA-Z0-9_]*)/# [link_name="rust_helper_\1"]\n pub fn \1/g' $@
279282$(objtree ) /rust/bindings_helpers_generated.rs : $(srctree ) /rust/helpers.c FORCE
0 commit comments