mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
The rule: `pub fn main` owns file descriptors 0, 1, and 2. If you didn't write `pub fn main()` it is, in general, not your business to print to stderr.
14 lines
251 B
Zig
14 lines
251 B
Zig
const std = @import("std");
|
|
|
|
pub fn main() void {
|
|
if (foo(1200, 34) != 1234) {
|
|
@compileError("bad");
|
|
}
|
|
}
|
|
|
|
inline fn foo(a: i32, b: i32) i32 {
|
|
std.debug.print("runtime a = {} b = {}", .{ a, b });
|
|
return a + b;
|
|
}
|
|
|
|
// exe=succeed
|