Commit 81277b5487

mlugg <mlugg@mlugg.co.uk>
2025-04-28 03:38:07
cbe: aggregate assignment does not need a second cast
`writeCValue` already emits a cast; including another here is, in fact, invalid, and emits errors under MSVC. Probably this code was originally added to work around the incorrect `.Initializer` location which was fixed in the previous commit.
1 parent 029cc06
Changed files (1)
src
codegen
src/codegen/c.zig
@@ -4980,11 +4980,6 @@ fn bitcast(f: *Function, dest_ty: Type, operand: CValue, operand_ty: Type) !CVal
         const operand_local = try f.allocLocal(null, operand_ty);
         try f.writeCValue(writer, operand_local, .Other);
         try writer.writeAll(" = ");
-        if (!operand_ty.isAbiInt(zcu)) {
-            try writer.writeByte('(');
-            try f.renderType(writer, operand_ty);
-            try writer.writeByte(')');
-        }
         try f.writeCValue(writer, operand, .Other);
         try writer.writeAll(";\n");
         break :blk operand_local;