mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
19 lines
286 B
Zig
19 lines
286 B
Zig
export fn foo() void {
|
|
var x: i32 = 1234;
|
|
x += 1;
|
|
_ = x;
|
|
}
|
|
export fn bar() void {
|
|
var b: u32 = 1;
|
|
_ = blk: {
|
|
const a = 1;
|
|
b = a;
|
|
break :blk a;
|
|
};
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :4:9: error: pointless discard of local variable
|
|
// :3:5: note: used here
|