On 2026-07-14 15:49:01 +0200, Vincent Lefevre wrote:
> On 2026-07-14 10:51:47 +0000, Alexy via Tinycc-devel wrote:
> >
> > No erros no warnings. Just compile and work
> >
> > #include <stdio.h>
> >
> > int main()
> > {
> > char* t[5] = {"999"};
> >
> > t[0] = "123456";
> > t[4] = "X";
> > t[15] = "abcdef";
> > t[25] = "MNO";
> > t[35] = "C";
> >
> > printf( "%s\n%s\n%s\n%s\n", *t, t[4], t[15], t[25] );
> > }
>
> This is undefined behavior. The compiler is not required to warn
> (and cannot always warn). With GCC, the issue is detected by using
> "-fsanitize=undefined".
Note that GCC also has -Warray-bounds, but it is unreliable:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
So I wouldn't expect tcc to be better, in addition to the fact
that tcc is designed to be a light and fast compiler.
--
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel