Hi, when compiling GCC Rust FE, clang gives the following warning:
/home/worker/buildworker/tiber-gcc-clang/build/gcc/rust/ast/rust-fmt.h:403:15: warning: 'collect_pieces' has C-linkage specified, but returns incomplete type 'FFIVec<Piece>' which could be incompatible with C [-Wreturn-type-c-linkage] /home/worker/buildworker/tiber-gcc-clang/build/gcc/rust/ast/rust-fmt.h:406:15: warning: 'clone_pieces' has C-linkage specified, but returns incomplete type 'FFIVec<Piece>' which could be incompatible with C [-Wreturn-type-c-linkage] I have raised this with GCC Rust folk on their Zulip chat and we agreed the warning should be filtered out, at least fornow. It is tracked as https://github.com/Rust-GCC/gccrs/issues/4441 so it is not forgotten but even there it seems that the outcome may be we'd just ignore the warning forever, as far as I can tell. I have tested this by running the script manually and committed is as pre-approved by Rust maintainers. contrib/ChangeLog: 2026-02-24 Martin Jambor <[email protected]> * filter-clang-warnings.py (skip_warning): Skip warning -Wreturn-type-c-linkage in rust/ast/rust-fmt.h. Fix indentation of the entry for libiberty/sha1.c. --- contrib/filter-clang-warnings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/filter-clang-warnings.py b/contrib/filter-clang-warnings.py index db94ee325a8..b964ab6f1f4 100755 --- a/contrib/filter-clang-warnings.py +++ b/contrib/filter-clang-warnings.py @@ -72,7 +72,10 @@ def skip_warning(filename, message): 'm2/gm2-compiler-boot': ['-Wunused-'], # Rust peopel promised to clean these warnings too 'rust/': ['-Wunused-private-field'], - 'libiberty/sha1.c': ['-Wc23-extensions'], + # except perhaps for this one, see + # https://github.com/Rust-GCC/gccrs/issues/4441 + 'rust/ast/rust-fmt.h': ['-Wreturn-type-c-linkage'], + 'libiberty/sha1.c': ['-Wc23-extensions'], 'libtool': [''] } -- 2.52.0
