ziglang/zig
263
5.9k
Fork
You've already forked zig
757

Make W a typed flag #31795

Open
bernardassan wants to merge 2 commits from bernardassan/zig:typed-W-flag into master
pull from: bernardassan/zig:typed-W-flag
merge into: ziglang:master
ziglang:master
ziglang:elfv2
ziglang:spork8
ziglang:restricted
ziglang:0.16.x
ziglang:panic-rewrite
ziglang:parking-futex-lockfree
ziglang:windows-Io-cleanup
ziglang:Io-watch
ziglang:ParseCommandLineOptions
ziglang:windows-async-files
ziglang:poll-ring
ziglang:debug-file-leaks-differently
ziglang:debug-file-leaks
ziglang:ProcessPrng
ziglang:elfv2-dyn
ziglang:jobserver
ziglang:threadtheft
ziglang:io-threaded-no-queue
ziglang:0.15.x
ziglang:Io.net
ziglang:comptime-allocator
ziglang:restricted-function-pointers
ziglang:cli
ziglang:wasm-linker-writer
ziglang:wrangle-writer-buffering
ziglang:sha1-stream
ziglang:async-await-demo
ziglang:fixes
ziglang:0.14.x
ziglang:ast-node-methods
ziglang:macos-debug-info
ziglang:make-vs-configure
ziglang:fuzz-macos
ziglang:sans-aro
ziglang:ArrayList-reserve
ziglang:incr-bug
ziglang:llvm-ir-nosanitize-metadata
ziglang:ci-tarballs
ziglang:ci-scripts
ziglang:threadpool
ziglang:0.12.x
ziglang:new-pkg-hash
ziglang:json-diagnostics
ziglang:more-doctests
ziglang:rework-comptime-mutation
ziglang:0.11.x
ziglang:ci-perf-comment
ziglang:stage2-async
ziglang:0.10.x
ziglang:autofix
ziglang:0.9.x
ziglang:aro
ziglang:hcs
ziglang:0.8.x
ziglang:0.7.x
First-time contributor
Copy link

this is part of my effort to considerably break down #31772 into smaller PR for easy review
which is part of the main goal of implementing #30067

type wait* syscall arguments correctly

type posix.errno as i64

Signed-off-by: Bernard Assan mega.alpha100@gmail.com

this is part of my effort to considerably break down https://codeberg.org/ziglang/zig/pulls/31772 into smaller PR for easy review which is part of the main goal of implementing https://codeberg.org/ziglang/zig/pulls/30067 type wait* syscall arguments correctly type `posix.errno` as `i64` Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>
bernardassan force-pushed typed-W-flag from 88c2006f03
Some checks failed
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-freebsd-release (pull_request) Failing after 25m21s
ci / x86_64-netbsd-release (pull_request) Successful in 34m46s
ci / x86_64-freebsd-debug (pull_request) Failing after 37m4s
ci / x86_64-netbsd-debug (pull_request) Successful in 43m54s
ci / aarch64-macos-release (pull_request) Successful in 50m2s
ci / x86_64-windows-release (pull_request) Successful in 50m4s
ci / x86_64-openbsd-release (pull_request) Successful in 49m51s
ci / x86_64-openbsd-debug (pull_request) Successful in 53m0s
ci / x86_64-windows-debug (pull_request) Successful in 1h4m23s
ci / aarch64-macos-debug (pull_request) Successful in 1h11m54s
ci / s390x-linux-release (pull_request) Successful in 1h23m9s
ci / aarch64-linux-release (pull_request) Successful in 1h25m16s
ci / x86_64-linux-debug (pull_request) Failing after 1h27m19s
ci / powerpc64le-linux-release (pull_request) Successful in 1h29m30s
ci / x86_64-linux-release (pull_request) Failing after 1h30m25s
ci / loongarch64-linux-release (pull_request) Successful in 1h55m58s
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
to ce27c432d6
All checks were successful
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Successful in 32m10s
ci / x86_64-freebsd-release (pull_request) Successful in 37m52s
ci / x86_64-linux-debug (pull_request) Successful in 46m18s
ci / x86_64-freebsd-debug (pull_request) Successful in 46m17s
ci / x86_64-openbsd-release (pull_request) Successful in 51m19s
ci / aarch64-macos-release (pull_request) Successful in 54m5s
ci / x86_64-netbsd-debug (pull_request) Successful in 54m40s
ci / x86_64-openbsd-debug (pull_request) Successful in 56m36s
ci / x86_64-windows-debug (pull_request) Successful in 58m40s
ci / x86_64-windows-release (pull_request) Successful in 59m45s
ci / aarch64-macos-debug (pull_request) Successful in 1h13m6s
ci / aarch64-linux-release (pull_request) Successful in 1h28m14s
ci / powerpc64le-linux-release (pull_request) Successful in 1h40m42s
ci / loongarch64-linux-release (pull_request) Successful in 1h47m56s
ci / s390x-linux-release (pull_request) Successful in 1h54m32s
ci / aarch64-linux-debug (pull_request) Successful in 2h52m16s
ci / x86_64-linux-release (pull_request) Successful in 2h55m48s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h59m2s
ci / s390x-linux-debug (pull_request) Successful in 3h10m36s
ci / loongarch64-linux-debug (pull_request) Successful in 3h43m11s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h51m32s
ci / aarch64-freebsd-debug (pull_request) Successful in 4h9m56s
ci / aarch64-freebsd-release (pull_request) Successful in 2h44m52s
ci / aarch64-netbsd-debug (pull_request) Successful in 4h2m58s
ci / aarch64-netbsd-release (pull_request) Successful in 2h43m32s
2026年04月09日 16:43:45 +02:00
Compare
bernardassan force-pushed typed-W-flag from ce27c432d6
All checks were successful
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-netbsd-release (pull_request) Successful in 32m10s
ci / x86_64-freebsd-release (pull_request) Successful in 37m52s
ci / x86_64-linux-debug (pull_request) Successful in 46m18s
ci / x86_64-freebsd-debug (pull_request) Successful in 46m17s
ci / x86_64-openbsd-release (pull_request) Successful in 51m19s
ci / aarch64-macos-release (pull_request) Successful in 54m5s
ci / x86_64-netbsd-debug (pull_request) Successful in 54m40s
ci / x86_64-openbsd-debug (pull_request) Successful in 56m36s
ci / x86_64-windows-debug (pull_request) Successful in 58m40s
ci / x86_64-windows-release (pull_request) Successful in 59m45s
ci / aarch64-macos-debug (pull_request) Successful in 1h13m6s
ci / aarch64-linux-release (pull_request) Successful in 1h28m14s
ci / powerpc64le-linux-release (pull_request) Successful in 1h40m42s
ci / loongarch64-linux-release (pull_request) Successful in 1h47m56s
ci / s390x-linux-release (pull_request) Successful in 1h54m32s
ci / aarch64-linux-debug (pull_request) Successful in 2h52m16s
ci / x86_64-linux-release (pull_request) Successful in 2h55m48s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h59m2s
ci / s390x-linux-debug (pull_request) Successful in 3h10m36s
ci / loongarch64-linux-debug (pull_request) Successful in 3h43m11s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h51m32s
ci / aarch64-freebsd-debug (pull_request) Successful in 4h9m56s
ci / aarch64-freebsd-release (pull_request) Successful in 2h44m52s
ci / aarch64-netbsd-debug (pull_request) Successful in 4h2m58s
ci / aarch64-netbsd-release (pull_request) Successful in 2h43m32s
to 60affcba17
Some checks failed
ci / x86_64-netbsd-release (pull_request) Successful in 33m36s
ci / x86_64-freebsd-release (pull_request) Successful in 37m3s
ci / x86_64-netbsd-debug (pull_request) Successful in 46m39s
ci / aarch64-macos-release (pull_request) Successful in 48m4s
ci / x86_64-freebsd-debug (pull_request) Successful in 49m27s
ci / x86_64-openbsd-release (pull_request) Successful in 51m10s
ci / x86_64-windows-release (pull_request) Successful in 51m25s
ci / x86_64-linux-debug (pull_request) Successful in 1h0m55s
ci / aarch64-macos-debug (pull_request) Successful in 1h4m9s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h6m2s
ci / x86_64-windows-debug (pull_request) Successful in 1h14m20s
ci / s390x-linux-release (pull_request) Successful in 1h19m21s
ci / aarch64-linux-release (pull_request) Successful in 1h25m46s
ci / powerpc64le-linux-release (pull_request) Successful in 1h32m35s
ci / loongarch64-linux-release (pull_request) Successful in 1h48m55s
ci / aarch64-linux-debug (pull_request) Successful in 2h31m24s
ci / s390x-linux-debug (pull_request) Successful in 2h33m18s
ci / x86_64-linux-release (pull_request) Successful in 2h34m44s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h35m53s
ci / loongarch64-linux-debug (pull_request) Successful in 2h44m24s
ci / powerpc64le-linux-debug (pull_request) Successful in 5h25m20s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Successful in 3h37m8s
ci / aarch64-freebsd-release (pull_request) Successful in 2h58m12s
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
2026年04月14日 17:47:38 +02:00
Compare
Author
First-time contributor
Copy link

@alexrp, can you please review when you have some time on your hands

@alexrp, can you please review when you have some time on your hands
andrewrk left a comment
Copy link

It's not ready for review yet because you're still doing more than 1 thing in this commit, and it needs a rebase on master.

It's not ready for review yet because you're still doing more than 1 thing in this commit, and it needs a rebase on master.
bernardassan force-pushed typed-W-flag from 60affcba17
Some checks failed
ci / x86_64-netbsd-release (pull_request) Successful in 33m36s
ci / x86_64-freebsd-release (pull_request) Successful in 37m3s
ci / x86_64-netbsd-debug (pull_request) Successful in 46m39s
ci / aarch64-macos-release (pull_request) Successful in 48m4s
ci / x86_64-freebsd-debug (pull_request) Successful in 49m27s
ci / x86_64-openbsd-release (pull_request) Successful in 51m10s
ci / x86_64-windows-release (pull_request) Successful in 51m25s
ci / x86_64-linux-debug (pull_request) Successful in 1h0m55s
ci / aarch64-macos-debug (pull_request) Successful in 1h4m9s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h6m2s
ci / x86_64-windows-debug (pull_request) Successful in 1h14m20s
ci / s390x-linux-release (pull_request) Successful in 1h19m21s
ci / aarch64-linux-release (pull_request) Successful in 1h25m46s
ci / powerpc64le-linux-release (pull_request) Successful in 1h32m35s
ci / loongarch64-linux-release (pull_request) Successful in 1h48m55s
ci / aarch64-linux-debug (pull_request) Successful in 2h31m24s
ci / s390x-linux-debug (pull_request) Successful in 2h33m18s
ci / x86_64-linux-release (pull_request) Successful in 2h34m44s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h35m53s
ci / loongarch64-linux-debug (pull_request) Successful in 2h44m24s
ci / powerpc64le-linux-debug (pull_request) Successful in 5h25m20s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Successful in 3h37m8s
ci / aarch64-freebsd-release (pull_request) Successful in 2h58m12s
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
to 859d270b3b
Some checks failed
ci / x86_64-netbsd-release (pull_request) Successful in 40m33s
ci / aarch64-macos-release (pull_request) Successful in 1h15m11s
ci / x86_64-freebsd-release (pull_request) Successful in 44m27s
ci / x86_64-netbsd-debug (pull_request) Successful in 57m6s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h1m11s
ci / aarch64-macos-debug (pull_request) Successful in 1h45m55s
ci / aarch64-linux-release (pull_request) Successful in 1h27m59s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h16m7s
ci / x86_64-openbsd-release (pull_request) Successful in 1h15m56s
ci / aarch64-linux-debug (pull_request) Successful in 2h21m15s
ci / x86_64-linux-debug (pull_request) Successful in 55m56s
ci / x86_64-windows-release (pull_request) Successful in 1h14m33s
ci / x86_64-windows-debug (pull_request) Successful in 1h39m43s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h49m15s
ci / x86_64-linux-release (pull_request) Successful in 2h56m46s
ci / s390x-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
2026年04月16日 13:39:52 +02:00
Compare
Author
First-time contributor
Copy link

I have rebased and removed the skipKernelLessThan bit

I have rebased and removed the `skipKernelLessThan` bit
bernardassan force-pushed typed-W-flag from 859d270b3b
Some checks failed
ci / x86_64-netbsd-release (pull_request) Successful in 40m33s
ci / aarch64-macos-release (pull_request) Successful in 1h15m11s
ci / x86_64-freebsd-release (pull_request) Successful in 44m27s
ci / x86_64-netbsd-debug (pull_request) Successful in 57m6s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h1m11s
ci / aarch64-macos-debug (pull_request) Successful in 1h45m55s
ci / aarch64-linux-release (pull_request) Successful in 1h27m59s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h16m7s
ci / x86_64-openbsd-release (pull_request) Successful in 1h15m56s
ci / aarch64-linux-debug (pull_request) Successful in 2h21m15s
ci / x86_64-linux-debug (pull_request) Successful in 55m56s
ci / x86_64-windows-release (pull_request) Successful in 1h14m33s
ci / x86_64-windows-debug (pull_request) Successful in 1h39m43s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h49m15s
ci / x86_64-linux-release (pull_request) Successful in 2h56m46s
ci / s390x-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
to f375753ad2
All checks were successful
ci / x86_64-netbsd-release (pull_request) Successful in 41m2s
ci / x86_64-freebsd-release (pull_request) Successful in 41m48s
ci / x86_64-freebsd-debug (pull_request) Successful in 50m56s
ci / x86_64-netbsd-debug (pull_request) Successful in 55m48s
ci / aarch64-macos-release (pull_request) Successful in 1h8m15s
ci / x86_64-openbsd-release (pull_request) Successful in 1h10m30s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h24m49s
ci / aarch64-linux-release (pull_request) Successful in 1h31m13s
ci / x86_64-linux-debug (pull_request) Successful in 1h2m30s
ci / aarch64-macos-debug (pull_request) Successful in 1h57m15s
ci / x86_64-windows-release (pull_request) Successful in 1h8m9s
ci / aarch64-linux-debug (pull_request) Successful in 2h22m43s
ci / x86_64-windows-debug (pull_request) Successful in 1h43m5s
ci / s390x-linux-release (pull_request) Successful in 1h26m7s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h22m51s
ci / x86_64-linux-release (pull_request) Successful in 3h19m38s
ci / s390x-linux-debug (pull_request) Successful in 2h52m15s
ci / powerpc64le-linux-release (pull_request) Successful in 1h19m22s
ci / powerpc64le-linux-debug (pull_request) Successful in 5h7m6s
ci / loongarch64-linux-release (pull_request) Successful in 2h10m33s
ci / loongarch64-linux-debug (pull_request) Successful in 3h14m21s
ci / aarch64-freebsd-debug (pull_request) Successful in 4h0m1s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-release (pull_request) Successful in 2h57m0s
ci / aarch64-netbsd-debug (pull_request) Successful in 3h50m2s
ci / aarch64-netbsd-release (pull_request) Successful in 2h41m22s
2026年04月16日 18:54:19 +02:00
Compare
Author
First-time contributor
Copy link

@andrewrk or @alexp, I would appreciate it if you could review and merge this if desirable, so that I can continue bringing in more bits and pieces from #31772 and #30067

@andrewrk or @alexp, I would appreciate it if you could review and merge this if desirable, so that I can continue bringing in more bits and pieces from #31772 and #30067
@ -1826,2 +1822,3 @@
pubfnwaitid(id_type:P,id:pid_t,infop:*siginfo_t,flags:u32,usage:?*rusage)usize{
pubfnwait4(pid:pid_t,status:?*W,flags:W,usage:?*rusage)pid_t{
return@intCast(syscall4(
First-time contributor
Copy link

I think that:
syscall4 on x86_64 when failed returns -1 (0xff_ff_ff_ff_ff_ff_ff_ff) u64
@intCast to i32 will panic

It will be helpful, for the reviewers, to explain why changing return type of this function from usize to pid_t.

I think that: syscall4 on x86_64 when failed returns -1 (0xff_ff_ff_ff_ff_ff_ff_ff) u64 @intCast to i32 will panic It will be helpful, for the reviewers, to explain why changing return type of this function from usize to pid_t.
Author
First-time contributor
Copy link

@ianic sorry for the late response, I just saw this. Your assessment is true.

The main motivation for changing the type was to make it obvious that what is actually returned from the syscall is a pid_t encoded as a usize just like what a few functions like getgid, getuid, and geteuid do, but then, these syscalls always succeed, making them valid special cases for breaking from the usize return type, unlike waitpid and wait4 which are failable.

I will update these syscalls to return usize as the others since their return type would have to be checked either way by errno which internally does the bitcast to isize and facilitates error checking. Thanks for the review

@ianic sorry for the late response, I just saw this. Your assessment is true. The main motivation for changing the type was to make it obvious that what is actually returned from the syscall is a `pid_t` encoded as a `usize` just like what a few functions like `getgid`, `getuid`, and `geteuid` do, but then, these syscalls always succeed, making them valid special cases for breaking from the `usize` return type, unlike `waitpid` and `wait4` which are failable. I will update these syscalls to return `usize` as the others since their return type would have to be checked either way by `errno` which internally does the bitcast to `isize` and facilitates error checking. Thanks for the review
bernardassan marked this conversation as resolved
bernardassan force-pushed typed-W-flag from f375753ad2
All checks were successful
ci / x86_64-netbsd-release (pull_request) Successful in 41m2s
ci / x86_64-freebsd-release (pull_request) Successful in 41m48s
ci / x86_64-freebsd-debug (pull_request) Successful in 50m56s
ci / x86_64-netbsd-debug (pull_request) Successful in 55m48s
ci / aarch64-macos-release (pull_request) Successful in 1h8m15s
ci / x86_64-openbsd-release (pull_request) Successful in 1h10m30s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h24m49s
ci / aarch64-linux-release (pull_request) Successful in 1h31m13s
ci / x86_64-linux-debug (pull_request) Successful in 1h2m30s
ci / aarch64-macos-debug (pull_request) Successful in 1h57m15s
ci / x86_64-windows-release (pull_request) Successful in 1h8m9s
ci / aarch64-linux-debug (pull_request) Successful in 2h22m43s
ci / x86_64-windows-debug (pull_request) Successful in 1h43m5s
ci / s390x-linux-release (pull_request) Successful in 1h26m7s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h22m51s
ci / x86_64-linux-release (pull_request) Successful in 3h19m38s
ci / s390x-linux-debug (pull_request) Successful in 2h52m15s
ci / powerpc64le-linux-release (pull_request) Successful in 1h19m22s
ci / powerpc64le-linux-debug (pull_request) Successful in 5h7m6s
ci / loongarch64-linux-release (pull_request) Successful in 2h10m33s
ci / loongarch64-linux-debug (pull_request) Successful in 3h14m21s
ci / aarch64-freebsd-debug (pull_request) Successful in 4h0m1s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-release (pull_request) Successful in 2h57m0s
ci / aarch64-netbsd-debug (pull_request) Successful in 3h50m2s
ci / aarch64-netbsd-release (pull_request) Successful in 2h41m22s
to bdfc364ae0
Some checks failed
ci / x86_64-netbsd-release (pull_request) Successful in 43m53s
ci / x86_64-netbsd-debug (pull_request) Successful in 48m8s
ci / x86_64-freebsd-debug (pull_request) Successful in 49m48s
ci / x86_64-freebsd-release (pull_request) Successful in 49m59s
ci / x86_64-openbsd-release (pull_request) Successful in 52m50s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-openbsd-debug (pull_request) Successful in 58m46s
ci / x86_64-windows-release (pull_request) Successful in 59m56s
ci / x86_64-linux-debug (pull_request) Successful in 1h4m41s
ci / aarch64-macos-release (pull_request) Successful in 1h13m29s
ci / x86_64-windows-debug (pull_request) Successful in 1h15m7s
ci / aarch64-linux-release (pull_request) Successful in 1h30m25s
ci / aarch64-macos-debug (pull_request) Successful in 1h40m3s
ci / s390x-linux-release (pull_request) Successful in 2h4m8s
ci / powerpc64le-linux-release (pull_request) Successful in 2h10m6s
ci / s390x-linux-debug (pull_request) Successful in 2h18m10s
ci / aarch64-linux-debug (pull_request) Successful in 2h22m13s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h2m42s
ci / x86_64-linux-release (pull_request) Successful in 4h6m52s
ci / loongarch64-linux-release (pull_request) Successful in 1h56m16s
ci / powerpc64le-linux-debug (pull_request) Successful in 5h58m57s
ci / loongarch64-linux-debug (pull_request) Successful in 3h25m5s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
2026年05月26日 02:31:19 +02:00
Compare
@ -15388,2 +15388,3 @@
constsyscall:Syscall=try.start();
while(true)switch(posix.errno(posix.system.wait4(pid,&status,0,ru_ptr))){
while(true)switch(posix.errno(
@intCast(posix.system.wait4(pid,&status,.{},ru_ptr)),

This @intCast is unnecessary (same goes for other changed wait4 callsites)

This `@intCast` is unnecessary (same goes for other changed `wait4` callsites)
Author
First-time contributor
Copy link

This is a residue of the previous change made. The @intCasts aren't required anymore, so I will remove them.

This is a residue of the previous change made. The `@intCast`s aren't required anymore, so I will remove them.
bernardassan marked this conversation as resolved
@ -4708,1 +4707,3 @@
@as(i32,if(child.request_resource_usage_statistics)linux.W.NOWAITelse0),
.splice_fd_in=@bitCast(linux.W{
.EXITED=true,
.NOWAIT=if(child.request_resource_usage_statistics)trueelsefalse,

This could be

.NOWAIT = child.request_resource_usage_statistics,
This could be ``` .NOWAIT = child.request_resource_usage_statistics, ```
Author
First-time contributor
Copy link

That's a good catch. I didn't check the type of request_resource_usage_statistics. Done, thanks.

That's a good catch. I didn't check the type of `request_resource_usage_statistics`. Done, thanks.
bernardassan marked this conversation as resolved
lib/std/c.zig Outdated
@ -74,3 +74,3 @@
/// Get the errno if rc is -1 and SUCCESS if rc is not -1.
pubfnerrno(rc:anytype)E{
pubfnerrno(rc:i64)E{

Why was this type changed?

Why was this type changed?
Author
First-time contributor
Copy link

Because the return types of all failable C library and system calls are always a signed integer. It's usually an i32 but specified as i64 to deal with cases where a system or library call returns isize like readlink*, readv, and lseek.

But can you think of an edge case where it isn't so, .ie can be another type?

Because the return types of all failable `C` library and system calls are always a signed integer. It's usually an `i32` but specified as `i64` to deal with cases where a system or library call returns `isize` like `readlink*`, `readv`, and `lseek`. But can you think of an edge case where it isn't so, .ie can be another type?

Not sure, but since it's completely unrelated to the rest of the changes, it just makes the PR more difficult to review.

Not sure, but since it's completely unrelated to the rest of the changes, it just makes the PR more difficult to review.
bernardassan marked this conversation as resolved
bernardassan force-pushed typed-W-flag from bdfc364ae0
Some checks failed
ci / x86_64-netbsd-release (pull_request) Successful in 43m53s
ci / x86_64-netbsd-debug (pull_request) Successful in 48m8s
ci / x86_64-freebsd-debug (pull_request) Successful in 49m48s
ci / x86_64-freebsd-release (pull_request) Successful in 49m59s
ci / x86_64-openbsd-release (pull_request) Successful in 52m50s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-openbsd-debug (pull_request) Successful in 58m46s
ci / x86_64-windows-release (pull_request) Successful in 59m56s
ci / x86_64-linux-debug (pull_request) Successful in 1h4m41s
ci / aarch64-macos-release (pull_request) Successful in 1h13m29s
ci / x86_64-windows-debug (pull_request) Successful in 1h15m7s
ci / aarch64-linux-release (pull_request) Successful in 1h30m25s
ci / aarch64-macos-debug (pull_request) Successful in 1h40m3s
ci / s390x-linux-release (pull_request) Successful in 2h4m8s
ci / powerpc64le-linux-release (pull_request) Successful in 2h10m6s
ci / s390x-linux-debug (pull_request) Successful in 2h18m10s
ci / aarch64-linux-debug (pull_request) Successful in 2h22m13s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h2m42s
ci / x86_64-linux-release (pull_request) Successful in 4h6m52s
ci / loongarch64-linux-release (pull_request) Successful in 1h56m16s
ci / powerpc64le-linux-debug (pull_request) Successful in 5h58m57s
ci / loongarch64-linux-debug (pull_request) Successful in 3h25m5s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
to c8273b3a7f
All checks were successful
ci / aarch64-macos-release (pull_request) Successful in 1h11m12s
ci / x86_64-netbsd-debug (pull_request) Successful in 56m29s
ci / x86_64-netbsd-release (pull_request) Successful in 53m49s
ci / x86_64-freebsd-release (pull_request) Successful in 58m48s
ci / aarch64-linux-release (pull_request) Successful in 1h32m22s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h12m36s
ci / aarch64-macos-debug (pull_request) Successful in 2h48m3s
ci / aarch64-linux-debug (pull_request) Successful in 2h30m24s
ci / x86_64-openbsd-release (pull_request) Successful in 1h1m23s
ci / powerpc64le-linux-release (pull_request) Successful in 2h6m16s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h8m54s
ci / x86_64-windows-release (pull_request) Successful in 1h8m6s
ci / x86_64-windows-debug (pull_request) Successful in 1h11m44s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h38m30s
ci / x86_64-linux-debug (pull_request) Successful in 1h1m37s
ci / s390x-linux-debug (pull_request) Successful in 2h40m25s
ci / s390x-linux-release (pull_request) Successful in 1h44m15s
ci / x86_64-linux-release (pull_request) Successful in 3h21m8s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h2m40s
ci / loongarch64-linux-release (pull_request) Successful in 2h3m39s
ci / loongarch64-linux-debug (pull_request) Successful in 3h16m50s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Successful in 4h12m15s
ci / aarch64-freebsd-release (pull_request) Successful in 3h32m24s
ci / aarch64-netbsd-debug (pull_request) Successful in 4h19m43s
ci / aarch64-netbsd-release (pull_request) Successful in 3h2m6s
2026年05月27日 04:23:07 +02:00
Compare
bernardassan force-pushed typed-W-flag from c8273b3a7f
All checks were successful
ci / aarch64-macos-release (pull_request) Successful in 1h11m12s
ci / x86_64-netbsd-debug (pull_request) Successful in 56m29s
ci / x86_64-netbsd-release (pull_request) Successful in 53m49s
ci / x86_64-freebsd-release (pull_request) Successful in 58m48s
ci / aarch64-linux-release (pull_request) Successful in 1h32m22s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h12m36s
ci / aarch64-macos-debug (pull_request) Successful in 2h48m3s
ci / aarch64-linux-debug (pull_request) Successful in 2h30m24s
ci / x86_64-openbsd-release (pull_request) Successful in 1h1m23s
ci / powerpc64le-linux-release (pull_request) Successful in 2h6m16s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h8m54s
ci / x86_64-windows-release (pull_request) Successful in 1h8m6s
ci / x86_64-windows-debug (pull_request) Successful in 1h11m44s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h38m30s
ci / x86_64-linux-debug (pull_request) Successful in 1h1m37s
ci / s390x-linux-debug (pull_request) Successful in 2h40m25s
ci / s390x-linux-release (pull_request) Successful in 1h44m15s
ci / x86_64-linux-release (pull_request) Successful in 3h21m8s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h2m40s
ci / loongarch64-linux-release (pull_request) Successful in 2h3m39s
ci / loongarch64-linux-debug (pull_request) Successful in 3h16m50s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Successful in 4h12m15s
ci / aarch64-freebsd-release (pull_request) Successful in 3h32m24s
ci / aarch64-netbsd-debug (pull_request) Successful in 4h19m43s
ci / aarch64-netbsd-release (pull_request) Successful in 3h2m6s
to 2d4c04e088
All checks were successful
ci / aarch64-netbsd-debug (pull_request) Has been skipped
ci / aarch64-freebsd-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Has been skipped
ci / aarch64-netbsd-release (pull_request) Has been skipped
ci / x86_64-netbsd-debug (pull_request) Successful in 1h15m26s
ci / x86_64-netbsd-release (pull_request) Successful in 1h2m6s
ci / aarch64-linux-release (pull_request) Successful in 1h37m32s
ci / x86_64-freebsd-release (pull_request) Successful in 1h13m31s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h17m20s
ci / x86_64-openbsd-release (pull_request) Successful in 1h8m55s
ci / aarch64-macos-release (pull_request) Successful in 1h54m31s
ci / powerpc64le-linux-release (pull_request) Successful in 2h8m59s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h38m49s
ci / aarch64-macos-debug (pull_request) Successful in 2h20m43s
ci / s390x-linux-release (pull_request) Successful in 1h30m39s
ci / x86_64-linux-debug (pull_request) Successful in 1h43m17s
ci / aarch64-linux-debug (pull_request) Successful in 2h44m25s
ci / x86_64-windows-release (pull_request) Successful in 1h18m48s
ci / x86_64-windows-debug (pull_request) Successful in 1h47m51s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h47m22s
ci / s390x-linux-debug (pull_request) Successful in 3h29m28s
ci / x86_64-linux-release (pull_request) Successful in 4h6m39s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h26m19s
ci / loongarch64-linux-release (pull_request) Successful in 2h41m36s
ci / loongarch64-linux-debug (pull_request) Successful in 3h47m52s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
2026年06月29日 01:04:10 +02:00
Compare
All checks were successful
ci / aarch64-netbsd-debug (pull_request) Has been skipped
ci / aarch64-freebsd-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Has been skipped
ci / aarch64-netbsd-release (pull_request) Has been skipped
ci / x86_64-netbsd-debug (pull_request) Successful in 1h15m26s
Required
Details
ci / x86_64-netbsd-release (pull_request) Successful in 1h2m6s
Required
Details
ci / aarch64-linux-release (pull_request) Successful in 1h37m32s
Required
Details
ci / x86_64-freebsd-release (pull_request) Successful in 1h13m31s
Required
Details
ci / x86_64-freebsd-debug (pull_request) Successful in 1h17m20s
Required
Details
ci / x86_64-openbsd-release (pull_request) Successful in 1h8m55s
Required
Details
ci / aarch64-macos-release (pull_request) Successful in 1h54m31s
Required
Details
ci / powerpc64le-linux-release (pull_request) Successful in 2h8m59s
Required
Details
ci / x86_64-openbsd-debug (pull_request) Successful in 1h38m49s
Required
Details
ci / aarch64-macos-debug (pull_request) Successful in 2h20m43s
Required
Details
ci / s390x-linux-release (pull_request) Successful in 1h30m39s
Required
Details
ci / x86_64-linux-debug (pull_request) Successful in 1h43m17s
Required
Details
ci / aarch64-linux-debug (pull_request) Successful in 2h44m25s
Required
Details
ci / x86_64-windows-release (pull_request) Successful in 1h18m48s
Required
Details
ci / x86_64-windows-debug (pull_request) Successful in 1h47m51s
Required
Details
ci / powerpc64le-linux-debug (pull_request) Successful in 3h47m22s
Required
Details
ci / s390x-linux-debug (pull_request) Successful in 3h29m28s
Required
Details
ci / x86_64-linux-release (pull_request) Successful in 4h6m39s
Required
Details
ci / x86_64-linux-debug-llvm (pull_request) Successful in 4h26m19s
Required
Details
ci / loongarch64-linux-release (pull_request) Successful in 2h41m36s
ci / loongarch64-linux-debug (pull_request) Successful in 3h47m52s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u typed-W-flag:bernardassan-typed-W-flag
git switch bernardassan-typed-W-flag
Sign in to join this conversation.
No reviewers
Labels
Clear labels
abi/f32
abi/ilp32
abi/sf
accepted
This proposal is planned.
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
The web application for interactive documentation and generation of its assets.
backend/c
The C backend outputs C source code.
backend/llvm
The LLVM backend outputs an LLVM bitcode module.
backend/self-hosted
The self-hosted backends produce machine code directly.
binutils
Zig's included binary utilities: zig ar, zig dlltool, zig lib, zig ranlib, zig objcopy, and zig rc.
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
build system
The Zig build system - zig build, std.Build, the build runner, and package management.
debug info
An issue related to debug information (e.g. DWARF) produced by the Zig compiler.
docs
An issue with documentation, e.g. the language reference or standard library doc comments.
error message
This issue points out an error message that is unhelpful and should be improved.
frontend
Tokenization, parsing, AstGen, ZonGen, Sema, Legalize, and Liveness.
fuzzing
An issue related to Zig's integrated fuzz testing.
incremental
Reuse of internal compiler state for faster compilation.
lib/c
This issue relates to Zig's libc implementation and/or vendored libcs.
lib/compiler-rt
This issue relates to Zig's compiler-rt library.
lib/cxx
This issue relates to Zig's vendored libc++ and/or libc++abi.
lib/std
This issue relates to Zig's standard library.
lib/tsan
This issue relates to Zig's vendored libtsan.
lib/ubsan-rt
This issue relates to Zig's ubsan-rt library.
lib/unwind
This issue relates to Zig's vendored libunwind.
linking
Zig's integrated object file and incremental linker.
miscompilation
The compiler reports success but produces semantically incorrect code.
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
This issue suggests language modifications. If it also has the "accepted" label then it is planned.
release notes
This issue or pull request should be mentioned in the release notes.
testing
This issue is related to testing the compiler, standard library, or other parts of Zig.
zig cc
Zig as a drop-in C-family compiler.
zig fmt
The Zig source code formatter.
zig reduce
The Zig source code reduction tool.
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
No labels
abi/f32
abi/ilp32
abi/sf
accepted
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
release notes
testing
zig cc
zig fmt
zig reduce
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
use case
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig!31795
Reference in a new issue
ziglang/zig
No description provided.
Delete branch "bernardassan/zig:typed-W-flag"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?