≈ the.bay.news

Why does `printf` work even though `link_libc = false`?

Ziggit
Why does `printf` work even though `link_libc = false`?
I’m trying to figure out what would prevent zig build from bringing in libc. (To satisfy my curiosity. Zig 0.17.0 on Macos from times past.) What do I have to change in build.zig to make zig build complain about either not finding stdio.h or printf (or both)? (And why?) To my surprise, this still builds and runs - adding the flag "-ffreestanding" would finally give me a complaint about not finding _main: build.zig const std = @import("std"); pub fn build(b: *std.Build) !void { const tar...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.