mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-08 08:40:08 +08:00
Sym.sym_scope and Sym.f (FuncAttr) share space, so blindly setting one clobbers the other. Right now this only leads to missing errors on incompatible typedefs (see testcase), which this commit fixes. But it points to a larger problem: Generally we can only manipulate Sym.f for anonymous and field symbols, not for anything that has a top-level name (basically any proper decl), because the latter use sym_scope. Luckily the functions type always contains an anonymous symbol (in sym->type.ref), so we can use that. But some of the functions attributes actually _do_ apply to the decl, not the type (e.g. always_inline), so we still have a problem possibly, when we update an pre-existing type that may already be shared with another decl. Would need untangling and perhaps using accessor functions that check that Sym.f and Sym.sym_scope aren't used for the same symbol. |
||
---|---|---|
.. | ||
pp | ||
tests2 | ||
42test.h | ||
abitest.c | ||
arm-asm-testsuite.sh | ||
asm-c-connect-1.c | ||
asm-c-connect-2.c | ||
asmtest.S | ||
boundtest.c | ||
bug.c | ||
gcctestsuite.sh | ||
libtcc_test_mt.c | ||
libtcc_test.c | ||
Makefile | ||
tcctest.c | ||
tcctest.h | ||
testfp.c | ||
vla_test.c |