Commit 61bf43d790

Jacob Young <jacobly0@users.noreply.github.com>
2022-10-05 10:57:27
c: fix switch on bool warning
1 parent da939b0
Changed files (1)
src
codegen
src/codegen/c.zig
@@ -3180,6 +3180,7 @@ fn airSwitchBr(f: *Function, inst: Air.Inst.Index) !CValue {
     const writer = f.object.writer();
 
     try writer.writeAll("switch (");
+    if (condition_ty.tag() == .bool) try writer.writeAll("(int)");
     try f.writeCValue(writer, condition);
     try writer.writeAll(") {");
     f.object.indent_writer.pushIndent();