Greetings, Found a strange error when trying to build a program with tcc. The error is ``` test.c:8: error: internal compiler error tccgen.c:7728: in init_assert(): initializer overflow ``` And here is a minimal example of how to repro it.
``` #include <stdio.h> struct A { char a; char b; }; int main() { struct A a[] = { (struct A){1}, (struct A){2}, }; printf("%d %d\n", a[0].a, a[0].b); printf("%d %d\n", a[1].a, a[1].b); return 0; } ``` (printing isn't need to repro the problem) Took a glance at the code that was generating the error message: `init_assert`. The commit message for that function seems to imply that is was temporary and removing this function avoid the error and allows the code to compile. Tests pass and the output is also as expected. Is there a reason to keep this function around? Playing around with the function removed and while the code compiles find, running with `tcc -run` segfaults. So I imagine the real fix is a bit less trivial that what I had thought. Arthur _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel