-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Description
Zig Version
0.12.0-dev.2619+5cf138e51
Steps to Reproduce and Observed Behavior
Build command: zig build-exe -OReleaseSmall -flto -fstrip -fsingle-threaded -target x86_64-windows main.zig
Code:
const std = @import("std");
pub fn main() void {
_ = std.fs.cwd().openFile("test", .{}) catch {};
_ = std.fs.cwd().createFile("test", .{}) catch {};
}
If I comment out any one line of the two, I get a 12KB exe file.
However, If I keep both two lines, I get a 140KB exe file. Also, I see very long zero bytes in the EXE file.
big.exe: both line.
small.exe: only the "openFile" line.
Expected Behavior
The exe should be smaller, maybe 10-20KB.
eldahine and basdp
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.