]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
contrib: Skip Clang -Wreturn-type-c-linkage in rust-fmt.h
authorMartin Jambor <mjambor@suse.cz>
Tue, 24 Feb 2026 16:32:32 +0000 (17:32 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 24 Feb 2026 16:37:17 +0000 (17:37 +0100)
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.

contrib/filter-clang-warnings.py

index db94ee325a87f620b36a0187e9c56b7ea476a7a7..b964ab6f1f4ad2443eb579dbeb8681d3a6347ec1 100755 (executable)
@@ -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': ['']
     }