zig
zig copied to clipboard
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
### Zig Version 0.9.0-dev.1686+696e51be4 ### Steps to Reproduce compile and run this with the latest master stage2: ```zig const plan9 = @import("std").os.plan9; pub fn main() void { const file =...
```zig test { var a: f16 = 5.5; var b: f128 = 2.5; var c: f128 = 6.25; try expect(@mulAdd(f128, a, b, c) == 20); } ```
zig-linux-x86_64-0.9.0-dev.720+871f6343f does not produce llvm IR/bitcode: ``` zig build-obj -femit-llvm-ir -fLLVM -lc hello.c zig cc -S -emit-llvm hello.c ``` produces hello.ll: ``` clang-12 -S -emit-llvm hello.c ```
This fixes #9786
On a system with a non-standard dynamic linker path, running `zig build test-behavior` results in `error: FileNotFound` when it attempts to execute cross-native tests. This is with Zig 0.8.1. As...
https://ziglang.org/learn/overview/#integration-with-c-libraries-without-ffibindings zig build test ./build.zig:8:48: error: array literal requires address-of operator to coerce to slice type '[]const []const u8' exe.addCSourceFile("test.c", [_][]const u8 {"-std=c99"}); seems slice is expected after make the...
Hello. When I link a library zig ignores my custom C include path. This happens with `zig build` using addIncludeDir / linkSystemLibrary and with `zig test`. This works: ``` +...
TLDR: zig is using "too new" glibc headers, which sometimes references undefined symbols. This fails compilation for at least sqlite and libuv when older glibc is selected, because it [redefines](https://sourceware.org/git/?p=glibc.git;a=blob;f=io/fcntl.h;h=6b0e9fa1fa2a2d8872b1adb5c0861410756a9e52;hb=3c03baca37fdcb52c3881e653ca392bba7a99c2b#l180)...
I have reduced this error to this minimal example: main.zig: ``` const std = @import("std"); const c = @cImport({ @cInclude("test.h"); }); pub fn main() !void { const num = c.getNum();...
I have an executable that I'm try to build linked to libc on Windows. If I try to use `std.os.getenv` I get this linker error: ``` lld-link: error: undefined symbol:...