zig
zig copied to clipboard
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
Like a saturating operator for assignment/conversions. Safe for all values with the exception of nan -> int. `@clampTo(i2, @as(f32, @trunc(-1023.33))) == -1 ` Like int -> int conversions in C,...
### Zig Version 0.12.0-dev.1138+530dc0405 ### Steps to Reproduce and Observed Behavior ``` $ zig env | jq .target "x86_64-linux.6.1.53...6.1.53-gnu.2.19" ``` Notice that the result is glibc 2.19. This is currently...
### Zig Version 0.12.0-dev.3180+83e578a18 ### Steps to Reproduce and Observed Behavior With a build.zig.zon file which contains a lazy dependency like: ``` .dependencies = .{ .glfw = .{ .url =...
### Zig Version 0.13.0-dev.4+c7ffdbcd4 ### Steps to Reproduce and Observed Behavior ```zig const std = @import("std"); test { var list = std.ArrayListAligned(u8, 4).init(std.testing.allocator); defer list.deinit(); try list.appendNTimes(1, 4); _ =...
### Zig Version 0.13.0-dev.3694+dddddcffd ### Steps to Reproduce and Observed Behavior OK, so I did a bad thing in my build.zig, and this isn't a blocker as I fixed my...
std.posix.accept: improve EINVAL's error name from SocketNotListening to SocketOrAddrLenIncorrect.
### Zig Version 0.12.0 ### Steps to Reproduce and Observed Output ### Error Message ``` error: SocketNotListening /home/randomuser/zig/0.12.0/files/lib/std/posix.zig:3836:27: 0x1035876 in accept (zig-posix_accept_err) .INVAL => return error.SocketNotListening, ^ /home/randomuser/Projects/Zig/zig-posix_accept_err/src/main.zig:20:22: 0x1034e55 in...
@andrewrk: [I re-opened this to propose reversing the decision](https://github.com/ziglang/zig/issues/2115#issuecomment-827968279) ----- A C enum allows multiple values. e.g. ```c enum Foo { OPTION1 = 0, OPTION2 = 1, DEFAULT = OPTION1,...
Code sample is based on [zig-bare][]: https://gist.github.com/leroycep/c0e1a85bcc558cd33a87143a26098128 [zig-bare]: https://git.sr.ht/~alva/zig-bare The `Reader` takes a tagged union and iterates over its fields to check if the next byte is equal to the...
Changed uses of `std.testing.expect` to `std.testing.expectEqual`, `std.testing.expectError`, and `std.testing.expectEqualStrings` where appropriate