enum
Test 1/8 enum ordinal value...OK
Test 2/8 set enum ordinal value...OK
Test 3/8 enum method...OK
Test 4/8 enum variant switch...OK
Test 6/8 @memberCount...OK
Test 8/8 @tagName...OK
All tests passed.
By default, enums are not guaranteed to be compatible with the C ABI:
test.zig
$ zig build-obj test.zig
/home/andy/dev/zig/docgen_tmp/test.zig:2:22: error: parameter of type 'Foo' not allowed in function with calling convention 'ccc'
export fn entry(foo: Foo) void {
test.zig
$ zig build-obj test.zig
packed enum
By default, the size of enums is not guaranteed.
test.zig
$ zig test test.zig
Test 1/1 packed enum...OK
All tests passed.
This makes the enum eligible to be in a .