decl: Allow union specifiers to contain structs/unions with flexible array members Thanks to Thorsten Glaser for reporting this issue. Fixes #91.
decl: Fix divide-by-zero with VLA of constant length and VLA element These are VLAs as well, so we should just leave size set to 0. It will be calculated in calcvla() like other VLAs. Thanks to Davide Di Paolo for reporting this issue.
init: Fix check for VLA types A VLA type can be incomplete (for example `int x[][n]`), which was not previously detected here, causing an assertion failure later on.
runtests: Don't include invalid tests in results
Add defineobj() function and use when we define an object This gives us a place to update alignment based on the final type, which is relevant for external definitions and tentative definitions. This fixes a bug where an object is declared with an incomplete struct type, the struct type is completed, and then the object is defined. This would previously result in an object declared with 0 alignment. Also, check for incomplete types when we are defining objects. Although the wording isn't clear in the C standard, and it doesn't seem to disallow a thread_local definition of an object with incomplete type, this doesn't make sense.
Add missing section comment
eval: Reuse decl from compound expression parsing In 593ca07956, we started creating a decl for compound literals during expression parsing, which was used by funclval(). However, eval() also created a declaration, which should have been changed at the same time.
Store enum constant value in struct decl
Implement variable length arrays Variably modified types are required for C23. Since QBE doesn't currently support saving and restoring the stack pointer, a current limitation is that we can't reclaim stack space from VLAs that go out of scope. This is potentially problematic for VLAs appearing in a loop, but this case is uncommon enough that it is silently ignored for now. Implements: https://todo.sr.ht/~mcf/cproc/1 References: https://todo.sr.ht/~mcf/cproc/88 Co-authored-by: Michael Forney <mforney@mforney.org>
qbe: Add extra size for strict alignment with QBE instruction With upcoming VLA support, the size might not be constant.
qbe: Temporarily set func->end = func->start in funcalloc This way way can just use funcinst.
Use hlt to implement noreturn
expr: Collapse *& when parsing
qbe: Use expression type when loading If we are loading the first element of an array, or first member of a structure, the expression type may be different from the object type.
decl: Move isnoreturn to struct decl It is a property of the declaration, not the type.
configure: Set DEFAULT_DYNAMIC_LINKER for riscv64-linux-gnu
README: Add riscv64 to supported targets
CI: Add debian-riscv64 builder
CI: Simplify alpine-aarch64.yml and debian-aarch64.yml
CI: Remove obsolete workaround for qemu-binfmt bug