The following program has an obvious bug, and both gcc and clang refuse
to compile it with an on-point error. tcc produces an incorrect warning and
creates code that has no chance of working:
#include <stdio.h>
>
> typedef struct symbol symbol;
> extern void foo(symbol *);
>
> int main()
> {
> foo(&(symbol){});
> return 0;
> }
>
> struct symbol {
> char *name;
> int size;
> };
>
> void foo(symbol *s)
> {
> printf("name=[%s]", s->name);
> }
>
tcc version 0.9.28rc 2023-11-08 mob@be8f894 (x86_64 Linux)
This is obviously not a show-stopper, but using an incomplete type _is_
something
that can happen in real life, and tcc does a pretty poor job here. I'd be
willing to take
a look if someone can give me some hints.
Thanks - Eric
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel