authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-04-28 02:38:07+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-04-28 02:38:07+01:00
log81277b5487e53d3e96351c2f1b14f437321210cc
tree7fe112523d8ea814264814c5fdd1350f483e50d3
parent029cc0640f2feb1f90959f234101f4aafd275561
signaturelock-open Commit is signed but in an unrecognized format.

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 files changed, 0 insertions(+), 5 deletions(-)

src/codegen/c.zig-5
......@@ -4980,11 +4980,6 @@ fn bitcast(f: *Function, dest_ty: Type, operand: CValue, operand_ty: Type) !CVal
49804980 const operand_local = try f.allocLocal(null, operand_ty);
49814981 try f.writeCValue(writer, operand_local, .Other);
49824982 try writer.writeAll(" = ");
4983 if (!operand_ty.isAbiInt(zcu)) {
4984 try writer.writeByte('(');
4985 try f.renderType(writer, operand_ty);
4986 try writer.writeByte(')');
4987 }
49884983 try f.writeCValue(writer, operand, .Other);
49894984 try writer.writeAll(";\n");
49904985 break :blk operand_local;