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...@@ -4980,11 +4980,6 @@ fn bitcast(f: *Function, dest_ty: Type, operand: CValue, operand_ty: Type) !CVal
4980 const operand_local = try f.allocLocal(null, operand_ty);4980 const operand_local = try f.allocLocal(null, operand_ty);
4981 try f.writeCValue(writer, operand_local, .Other);4981 try f.writeCValue(writer, operand_local, .Other);
4982 try writer.writeAll(" = ");4982 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 }
4988 try f.writeCValue(writer, operand, .Other);4983 try f.writeCValue(writer, operand, .Other);
4989 try writer.writeAll(";\n");4984 try writer.writeAll(";\n");
4990 break :blk operand_local;4985 break :blk operand_local;