Translate-C doesn't currently work on Zig master, fix for the issue (std.ArrayList now needs to be initialized as .empty not .{}) was merged in https://github.com/Vexu/arocc/pull/975.
Update Aro and Zig #305
The test failure is the result of changes made in zig#31403 where pointer types with explicit alignment are no longer considered equal to otherwise same pointers without explicit alignment (*u8 != *align(1) u8). The type of field alignment in std.builtin.Type.Pointer also changed from comptime_int to ?usize where null means implicit alignment, which is equivalent to @alignOf(child). The fix for this issue is either setting the @"align" in FlexibleArrayType to null:
/// Constructs a [*c] pointer with the const and volatile annotations
/// from SelfType for pointing to a C flexible array of ElementType.
pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type {
switch (@typeInfo(SelfType)) {
.pointer => |ptr| {
return @Pointer(.c, .{
.@"const" = ptr.is_const,
.@"volatile" = ptr.is_volatile,
.@"allowzero" = true,
.@"addrspace" = .generic,
- .@"align" = @alignOf(ElementType),
+ .@"align" = null,
}, ElementType, null);
},
else => |info| @compileError("Invalid self type \"" ++ @tagName(info) ++ "\" for flexible array getter: " ++ @typeName(SelfType)),
}
}
or adding explicit alignment to the expected types in FlexibleArrayType test. Let me know which one is preferred.
Explicit alignment is not needed.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?