Closed iacore closed 1 year ago
Shouldn't that @cInclude
be for dummy.c
, that way the implementation is there?
Shouldn't that
@cInclude
be fordummy.c
, that way the implementation is there?
That will be a compiler error. However, when linking with dynamic library/existing object files, only struct/function definitions should be used
Shouldn't that
@cInclude
be fordummy.c
, that way the implementation is there?That will be a compiler error. However, when linking with dynamic library/existing object files, only struct/function definitions should be used
Ah, sorry I misunderstood that you were linking it separately there.
C ABI issues should be mostly solved.
When you use valid C code to initialize a struct, the result isn't valid. I don't think that should be allowed to compile.
When a C struct is used during multiple compilations, their layout can change. Maybe it's some other bug I don't understand. This leads to very janky behavior like having -nan where assigned field should be. This may make the project compile but behave wrong. This is certainly very evil.
This happens when you have a C library header file that can be used as definition only or includes implementation. So far, this breaks Nuklear and microui
Here's a minimal project that reproduces the bug: https://github.com/locriacyber/test-zig-nuklear run
make
and then compare the output of two produced executablesrelated to #1481