@@ -6,7 +6,7 @@ always-$(CONFIG_RUST) += exports_core_generated.h
6
6
# Missing prototypes are expected in the helpers since these are exported
7
7
# for Rust only, thus there is no header nor prototypes.
8
8
obj-$(CONFIG_RUST) += helpers.o
9
- CFLAGS_REMOVE_helpers.o = -Wmissing-prototypes
9
+ CFLAGS_REMOVE_helpers.o = -Wmissing-prototypes -Wmissing-declarations
10
10
11
11
always-$(CONFIG_RUST) += libmacros.so
12
12
no-clean-files += libmacros.so
@@ -269,11 +269,14 @@ $(objtree)/rust/bindings_generated.rs: $(srctree)/rust/kernel/bindings_helper.h
269
269
$(srctree)/rust/bindgen_parameters FORCE
270
270
$(call if_changed_dep,bindgen)
271
271
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.
273
276
$(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_flags = \
274
277
--blacklist-type '.*' --whitelist-var '' --whitelist-function 'rust_helper_.*'
275
278
$(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
277
280
$(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_extra = ; \
278
281
sed -Ei 's/pub fn rust_helper_([a-zA-Z0-9_]*)/# [link_name="rust_helper_\1"]\n pub fn \1/g' $@
279
282
$(objtree ) /rust/bindings_helpers_generated.rs : $(srctree ) /rust/helpers.c FORCE
0 commit comments