[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Proposal to allow tcc to compile header files

From: Tyge Løvset
Subject: Re: [Tinycc-devel] Proposal to allow tcc to compile header files
Date: Mon, 28 Jun 2021 12:19:44 +0200

I agree that .h files could be accepted by default, although a good practice is to use -x c, as it could be a c++ header that would work with gcc but not tcc.
However I don't think -Tc should be added on Windows, as tcc does not accept cl.exe options in general like clang-cl does. The -x option works fine on windows.

On Sun, 27 Jun 2021 at 08:24, Christian Jullien <eligis@orange.fr> wrote:

Tcc already accepts –x option which is compatible with gcc. If no –x c option is supplied, gcc compiles a .h as if it was a .c file but tcc complains.

So, tcc will be more compatible with gcc if it does the same (i.e. w.o. –x c option).


$ gcc -x c foo.h –o foo

$ tcc -x c foo.h –o foo


To be complete, it should also support –Tc option on Windows which is what VC++ does to compile any extension as a C file.


c:>cl -nologo -Tc foo.h





From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On Behalf Of Arthur Williams
Sent: Sunday, June 27, 2021 07:59
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] Proposal to allow tcc to compile header files


I've noticed some programs (eg strace) fail to compile with tcc because they try to compile a header and tcc fails with "unrecognized file type". Compiling the header as if it was a ".c" seems like a safe thing to do and is a simple patch.

Any objections/concerns? I'm not trying to defend/encourage the act of compiling headers, but would prefer to not have to patch all the offending packages if it could be avoided.

Tinycc-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]