contrib: Skip Clang -Wreturn-type-c-linkage in rust-fmt.h

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.

contrib/ChangeLog:

2026-02-24  Martin Jambor  <mjambor@suse.cz>

	* 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.
This commit is contained in:
Martin Jambor
2026-02-24 17:32:32 +01:00
committed by Martin Jambor
parent 4cd4ec9bd3
commit 02bc692a23

View File

@@ -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': ['']
}