Zig Version
0.16.0-dev.2821+3edaef9e0
Steps to Reproduce and Observed Behavior
I think this is a direct consequence of the awesome work done in #31403. Now, Packed structs without an explicit backing integer type can't be used as fields in extern structs/unions. This breaks std.os.linux.perf_event_attr:
conststd=@import("std");constlinux=std.os.linux;pubfnmain()void{varattr=linux.perf_event_attr{.type=.HARDWARE,.config=@intFromEnum(linux.PERF.COUNT.HW.INSTRUCTIONS),.flags=.{.disabled=true,.exclude_kernel=true,.exclude_hv=true,.inherit=true,.enable_on_exec=true,},};_=linux.perf_event_open(&attr,0,-1,-1,linux.PERF.FLAG.FD_CLOEXEC,);}
with the error:
/home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/os/linux.zig:9518:19: error: extern structs cannot contain fields of type 'os.linux.perf_event_attr__struct_32488'
flags: packed struct {
~~~~~~~^~~~~~
/home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/os/linux.zig:9518:19: note: inferred backing integer of packed struct has unspecified signedness
/home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/os/linux.zig:9518:19: note: struct declared here
referenced by:
main: repro.zig:6:18
callMain [inlined]: /home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/start.zig:677:59
callMainWithArgs [inlined]: /home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/start.zig:629:20
posixCallMainAndExit: /home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/start.zig:582:38
2 reference(s) hidden; use '-freference-trace=6' to see all references
Expected Behavior
std.os.linux.perf_event_attr and other types that use packed structs inside extern types in the stdlib should be usable
### Zig Version
0.16.0-dev.2821+3edaef9e0
### Steps to Reproduce and Observed Behavior
I think this is a direct consequence of the awesome work done in #31403. Now, Packed structs without an explicit backing integer type can't be used as fields in extern structs/unions. This breaks `std.os.linux.perf_event_attr`:
```zig
const std = @import("std");
const linux = std.os.linux;
pub fn main() void {
var attr = linux.perf_event_attr{
.type = .HARDWARE,
.config = @intFromEnum(linux.PERF.COUNT.HW.INSTRUCTIONS),
.flags = .{
.disabled = true,
.exclude_kernel = true,
.exclude_hv = true,
.inherit = true,
.enable_on_exec = true,
},
};
_ = linux.perf_event_open(
&attr,
0,
-1,
-1,
linux.PERF.FLAG.FD_CLOEXEC,
);
}
```
with the error:
```
/home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/os/linux.zig:9518:19: error: extern structs cannot contain fields of type 'os.linux.perf_event_attr__struct_32488'
flags: packed struct {
~~~~~~~^~~~~~
/home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/os/linux.zig:9518:19: note: inferred backing integer of packed struct has unspecified signedness
/home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/os/linux.zig:9518:19: note: struct declared here
referenced by:
main: repro.zig:6:18
callMain [inlined]: /home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/start.zig:677:59
callMainWithArgs [inlined]: /home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/start.zig:629:20
posixCallMainAndExit: /home/phugen/.zv/versions/master/0.16.0-dev.2821+3edaef9e0/lib/std/start.zig:582:38
2 reference(s) hidden; use '-freference-trace=6' to see all references
```
### Expected Behavior
`std.os.linux.perf_event_attr` and other types that use packed structs inside extern types in the stdlib should be usable