btw state of C backend looks better now, (削除) but I'm unable to actually build generated code... maybe I forgot some import (削除ここまで) upd: well, now it crashes :):
$ /usr/lib64/zig/9999/bin/zig build-exe /home/bratishkaerik/ncdu/src/main.zig /home/bratishkaerik/ncdu/src/ncurses_refs.c -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncursesw -lncursesw -ltinfow -lc --name ncdu -ofmt=c -fno-strip
$ /usr/lib64/zig/9999/bin/zig build-obj /usr/lib64/zig/9999/lib/compiler_rt.zig -fPIC -fno-strip
$ ncdu
6.8 MiB [#################################] ncdu.c
1.3 MiB [###### ] compiler_rt.o.o
1.3 MiB [###### ] compiler_rt.o
$ clang compiler_rt.o.o ncdu.c /home/bratishkaerik/ncdu/src/ncurses_refs.c -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/lib64/zig/9999/lib/ -I/usr/include/ncursesw -lncursesw -ltinfow -lm -lpthread -lc -ldl -lrt -lutil
ncdu.c:8503:42: warning: declaration of built-in function 'fopen' requires inclusion of the header <stdio.h> [-Wbuiltin-requires-header]
zig_extern struct struct__IO_FILE__9566 *fopen(char const *, char const *);
# myriad of similar warnings...
$ ./a.out
Segmentation fault at address 0x0
???:?:?: 0x55d0bd90b0f4 in ??? (???)
???:?:?: 0x55d0bd91dd58 in ??? (???)
???:?:?: 0x55d0bd983fde in ??? (???)
???:?:?: 0x55d0bd9841d7 in ??? (???)
???:?:?: 0x55d0bd9841d7 in ??? (???)
???:?:?: 0x55d0bd8ccbfc in ??? (???)
???:?:?: 0x55d0bd8cb851 in ??? (???)
???:?:?: 0x55d0bd8bfa01 in ??? (???)
???:?:?: 0x55d0bd8bd15b in ??? (???)
[1] 17088 IOT instruction ./a.out
$ zig cc compiler_rt.o.o ncdu.c /home/bratishkaerik/ncdu/src/ncurses_refs.c -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/lib64/zig/9999/lib/ -I/usr/include/ncursesw -lncursesw -ltinfow -lm -lpthread -lc -ldl -lrt -lutil
ncdu.c:8503:42: warning: declaration of built-in function 'fopen' requires inclusion of the header <stdio.h> [-Wbuiltin-requires-header]
zig_extern struct struct__IO_FILE__9566 *fopen(char const *, char const *);
# myriad of similar warnings...
$ ./a.out
Illegal instruction at address 0x378f21
/home/bratishkaerik/ncdu/ncdu.c:60724:35: 0x378f21 in model_Entry_alloc__anon_11599__11599 (ncdu.c)
(*t17) = zig_or_u64(zig_and_u64((*t17), UINT64_C(0xfffffffffffffffc)), zig_shl_u64((uint64_t)a0, UINT8_C(0)));
^
/home/bratishkaerik/ncdu/ncdu.c:29680:9: 0x33f53b in model_Entry_create__5080 (ncdu.c)
t1 = model_Entry_alloc__anon_11599__11599(a0, a1, a2);
^
/home/bratishkaerik/ncdu/ncdu.c:30069:8: 0x385d26 in scan_ScanDir_addStat__4898 (ncdu.c)
t16 = model_Entry_create__5080(t0, t28, a1);
^
/home/bratishkaerik/ncdu/ncdu.c:19915:9: 0x337368 in scan_Context_addStat__4890 (ncdu.c)
t18 = scan_ScanDir_addStat__4898(t32, t16, t20);
^
/home/bratishkaerik/ncdu/ncdu.c:32226:3: 0x3e88d8 in scan_scanDir__4860 (ncdu.c)
scan_Context_addStat__4890(t16, a3);
^
/home/bratishkaerik/ncdu/ncdu.c:20155:2: 0x2aeddc in scan_scan__4863 (ncdu.c)
scan_scanDir__4860(t5, t31, t26, t30);
^
/home/bratishkaerik/ncdu/ncdu.c:12358:2: 0x2aceec in scan_scanRoot__4861 (ncdu.c)
scan_scan__4863();
^
/home/bratishkaerik/ncdu/ncdu.c:13137:8: 0x29b157 in main_main__168 (ncdu.c)
t23 = scan_scanRoot__4861(t11, t53);
^
/home/bratishkaerik/ncdu/ncdu.c:13469:2: 0x29768f in main (ncdu.c)
main_main__168();
^
[1] 18188 IOT instruction ./a.out