Hello,
On Mon, 15 Feb 2021, Herman ten Brugge via Tinycc-devel wrote:
I ran the tests/gcctestsuite.sh script and found one test that dumps core.
($GCC_DIR/gcc/testsuite/gcc.c-torture/compile/pr28865.c)
The reduced testcase is:
struct A { int a; char b[]; };
struct A a = { 1, "1" };
struct B { struct A a; };
struct B b = { { 1, "1" } };
line 2 works and line 4 dumps core.
I am not sure how to fix this.
Fixed in mob. The cause is the discrepancy in handling string vs. normal
array initializers. The former wasn't checking for the problematic
situation.
(Note that TCC and GCC behave different with non-top-level flex array
members: GCC accepts but discards initializers of these with a warning,
TCC rejects them. That's fine, flex array members are an extension.)
Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel