# Why does tcc report such an error?



## sw2wolf (Jan 3, 2015)

After upgrading to 9.3 from 9.1, TCC always report:

```
/usr/include/stdio.h:63: error: ';' expected (got "va_list")

#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#ifndef _VA_LIST_DECLARED
typedef __va_list va_list;   <--- line 63
#define _VA_LIST_DECLARED
#endif
#endif
```
IIRC, there is no such an error on 9.1.

Regards!


----------



## junovitch@ (Jan 3, 2015)

According to the source website for TCC (http://bellard.org/tcc/), lang/tcc, the project is no longer actively being worked on. Considering those lines of code above were written 12 years ago (Source: http://svnweb.freebsd.org/base?view=revision&revision=104585), it seems the most likely explanation is the unmaintained TCC rather than code cited above.  Can you use a more modern compiler or is there another option?


----------



## sw2wolf (Jan 4, 2015)

junovitch said:


> According to the source website for TCC (http://bellard.org/tcc/), lang/tcc, the project is no longer actively being worked on. Considering those lines of code above were written 12 years ago (Source: http://svnweb.freebsd.org/base?view=revision&revision=104585), it seems the most likely explanation is the unmaintained TCC rather than code cited above.  Can you use a more modern compiler or is there another option?


I am using GCC/Clang now. The TinyTCC is just being used for study.  BTW, I have sent the issue to TCC mailing list.

Regards!


----------



## cpm@ (Jul 23, 2015)

Hi,

This problem isn't fixed ATM. For further details, see PR 201749.


----------



## cpm@ (Jul 24, 2015)

stdio.h is the culprit.

```
extern int printf(char *, ...);
int main(){
            printf("hello, world!\n");
            return 0;
}
```
Test:

```
% tcc -run hello.c
hello, world!
```


----------



## Crivens (Jul 24, 2015)

What if you preprocess the code with the system cc and the compile the output with tcc? It looks like a preprocessor problem, maybe maximum include depth reached or something...


----------



## cpm@ (Jul 24, 2015)

```
% cc -E hello.c -o hello.i
% tcc -c hello.i
hello.i:1: error: unrecognized file type
```
Strange, but there is no problem with the same test if

```
% cc -c hello.i
% cc -o hello hello.c
% ./hello
Hello, World!
```


----------



## cpm@ (Aug 4, 2015)

It's a known TCC bug:
http://savannah.nongnu.org/bugs/?30966

PS. Thanks to *jkim@* for the finding.


----------



## cpm@ (Aug 5, 2015)

PR 202093 fixes the problem partially. TinyCC is able to compile but it fails to link (currently investigating this further).

Using -run option works fine again.


----------

