https://gcc.gnu.org/g:02bc692a235e37941048c4c5282ba47f32a5f9bb

commit r16-7660-g02bc692a235e37941048c4c5282ba47f32a5f9bb
Author: Martin Jambor <[email protected]>
Date:   Tue Feb 24 17:32:32 2026 +0100

    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  <[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.

Diff:
---
 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 db94ee325a87..b964ab6f1f4a 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': ['']
     }

Reply via email to