| ... | ... | @@ -655,11 +655,11 @@ pub const DeclGen = struct { |
| 655 | 655 | return dg.fail("TODO: C backend: implement lowering large float values", .{}); |
| 656 | 656 | }, |
| 657 | 657 | .Pointer => switch (val.tag()) { |
| 658 | | .null_value => try writer.writeAll("NULL"), |
| 659 | | // Technically this should produce NULL but the integer literal 0 will always coerce |
| 660 | | // to the assigned pointer type. Note this is just a hack to fix warnings from ordered comparisons (<, >, etc) |
| 661 | | // between pointers and 0, which is an extension to begin with. |
| 662 | | .zero => try writer.writeByte('0'), |
| 658 | .null_value, .zero => { |
| 659 | try writer.writeAll("(("); |
| 660 | try dg.renderTypecast(writer, ty); |
| 661 | try writer.writeAll(")NULL)"); |
| 662 | }, |
| 663 | 663 | .variable => { |
| 664 | 664 | const decl = val.castTag(.variable).?.data.owner_decl; |
| 665 | 665 | return dg.renderDeclValue(writer, ty, val, decl); |