Hi! On 2021-08-02T00:37:37+0200, Mark Wielaard <m...@klomp.org> wrote: > On Sun, Aug 01, 2021 at 01:29:16PM +0200, Mark Wielaard wrote: >> I added two simple testcases to show the basic support for unions >> works now. But there are a couple of things that don't work correctly >> for unions yet. In particular when enabling warnings for the new >> union.rs testcase you'll get: >> >> $ gcc/gccrs -Bgcc -g union.rs >> union.rs:18:3: warning: field is never read: ‘f1’ >> 18 | f1: U, >> | ^ >> union.rs:19:3: warning: field is never read: ‘f2’ >> 19 | f2: V >> | ^ >> >> But those (union) fields in the struct are read. Similarly unused >> union fields aren't detected. > > This is why the testcase uses { dg-options "-w" } to suppress all > warnings.
For that one, I've put in <https://github.com/Rust-GCC/gccrs/pull/604> "Handle 'UnsafeBlockExpr' in liveness analysis". Hope I got that right; someone please review. > Attached is a small followup patch to resolve two FIXMEs to add the > correct locus for the Union variant fields (the actual fixme was fixed > by Thomas Young in commit 6d7b87f9dd92 "make struct field carry the > location info"). But it was missing TupleField and (obviously) > Union variants since those weren't implemented yet. > > Also on > https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=tuple-union-field-locus For that one, Marc P. filed <https://github.com/Rust-GCC/gccrs/pull/602> "Add locus to TupleField and pass it and union variants to HIR class". Grüße thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 -- Gcc-rust mailing list Gcc-rust@gcc.gnu.org https://gcc.gnu.org/mailman/listinfo/gcc-rust