Files
ziran/cmd
waozi f00a8d5b49 Write a closed C program's entry as C's main itself
A program linked with --entry and built with --exe, or with its own
exported main, no longer gets a separate ziran_exe_main.c that calls
<module>_main. zi2c writes the entry's body as int main(void), or as
int main(int argc, char **argv) when the body uses its parameters: an s32
count is main's own parameter, other types the body reads are copied from
main's, and an entry with no result returns 0. hello's C is now one
int main in hello.c with no header.

The entry keeps its own name and the wrapper when other code calls it or
takes it as a value (ProgramUsesFunction in zir_link.c), when it is
exported under another symbol, when it carries assembly or #target
clones, in library builds and with --no-main, which now does what it
says. tests/native_entry_cases.zi checks hello's C against a fixture and
builds every native entry fixture as a closed program.

Also regenerates site/guide/zx.html, which docs/ZX.md had left stale.
2026-11-15 22:09:54 -03:00
..
2026-10-18 20:18:56 -03:00