You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which causes the various C compilers I've tried (clang and gcc) to emit this error when attempting to compile the output:
test.c:6695:43: error: array has incomplete element type 'struct test_main__struct_1841__1841'
struct test_main__struct_1841__1841 (*t0)[4];
^
test.c:60:8: note: forward declaration of 'struct test_main__struct_1841__1841'
struct test_main__struct_1841__1841; /* test.main__struct_1841 */
^
Even though the value itself is a pointer, it seems the array declaration requires the element type to be fully-defined beforehand.
This behavior exists back to at least zig 0.11.0.
Expected Behavior
The emitted C code should contain the correctly resolved types.
The text was updated successfully, but these errors were encountered:
torque
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Sep 18, 2024
torque
changed the title
C backend: pointer to array of value does not get emitted properly
C backend: pointer to array of non-simple value does not get emitted properly
Sep 18, 2024
Zig Version
0.14.0-dev.1583+812557bfd
Steps to Reproduce and Observed Behavior
The output C file has something like this:
which causes the various C compilers I've tried (clang and gcc) to emit this error when attempting to compile the output:
Even though the value itself is a pointer, it seems the array declaration requires the element type to be fully-defined beforehand.
This behavior exists back to at least zig 0.11.0.
Expected Behavior
The emitted C code should contain the correctly resolved types.
The text was updated successfully, but these errors were encountered: