User avatar
Umur Gedik @umurgdk@mastodon.social
1w
I think I've found a compiler bug. When passing extern structs with f32 static arrays to C functions or C functions returning a struct with a static array field. All data is corrupted. For both sides. If you return or pass struct { float x, y, z } problem disappears. I wonder if this is reported. I'm not sure how to search issues for this problem

Reported anyways:
codeberg.org/ziglang/zig/issues/36195
1
2
2
0
User avatar
Umur Gedik @umurgdk@mastodon.social
1w
There is a stackoverflow post saying this might be a undefined behavior in C as well? So it might not be a problem, and zig developers might be aware of this?
1
0
2
0
User avatar
illy [Shrimple-mode] protomoji_orange_flag_lesbian @illyBytes@shrimp.imsofucking.gay
1w
@umurgdk you should still maybe open an issue about this

also maybe also test if this bug happens on other backends
1
0
0
0

User avatar
Umur Gedik @umurgdk@mastodon.social
1w
@illyBytes Yeah I'm tracing the issues at codeberg repo to see if it has been reported, but probably this kind of issues has a technical name for compiler people which I'm not aware of. Also it happens on both native x86_64 backend as well as llvm backend
1
0
1
0
User avatar
Cian O'Connor @cian@post.lurk.org
1w
@umurgdk @illyBytes

You could go on the Zig forum, or Discord, and start a conversation about it if you're worried.
0
0
1
0