Hmm...
The
static build dynamic link of tcc-next-unreleased posted in the DIT-KeK thread:
Code:
(armv6l:1) /home # tcc -run un.c
This program was called with "un.c".
The command had no other arguments.
(armv6l:1) /home # tcc -run un.c junk
This program was called with "un.c".
argv[-1094246539] = argv[%d] = %s
But that build has some strange ideas about the standard libraries, the posted code needs to be changed to run under the DIY-KeK build:
Code:
(armv6l:1) /home # cat un.c
/* #include "stdio.h" */
/* #include <stdlib.h> */
int main(int argc, char **argv) {
int count;
printf ("This program was called with \"%s\".\n", argv[0]);
if (argc > 1)
for (count = 1; count < argc; count++)
printf("argv[%d] = %s\n", count, argv[count]);
else
printf("The command had no other arguments.\n");
return 0;
}
That first line change - I don't know why the author was expecting stdio.h to be in the current directory ;
The second line change - That is part of the changes required for tcc-next-release.
I haven't looked to see if it is an error in tcc or an intended feature to have (some) of the standard libraries built-in and blow up if the external libraries are used.