[Top][All Lists]

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

Re: [Tinycc-devel] issues/questions with stddef.h which comes with tcc

From: Christian Jullien
Subject: Re: [Tinycc-devel] issues/questions with stddef.h which comes with tcc
Date: Fri, 1 Jan 2021 18:12:41 +0100

The Windows case is more clear to me, as windows does not have compiler hence no standard includes, the win32/include part contains all the stuff to let tcc find its includes (most of its includes). It contains std C headers and the most common windows headers.


My concern is with includes that are installed with “make install” and go to /usr/local/lib/tcc by default.




From: Joshua Scholar [mailto:joshuascholar@gmail.com]
Sent: Friday, January 01, 2021 17:24
To: jullien@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] issues/questions with stddef.h which comes with tcc


I noticed that in the win32 directory there are 46 include files in the main include directory, 9 in include/sys, there's a secure api directory with 12 files, an a libtcc directory with an include file and a def file.. but the include directory for the non-windows build only has 9 files, so I guess it's relying on the system to have another C compiler installed whose .h files it can use.  I haven't been here long, but it does sound like a bad idea to not include your own include files for every platform. 


Does that mean you have to have GCC installed?  It's awfully confident of them to be sure that every GCC include tree will work. Does Clang work? Is it a license issue?  If so, that's passing the license issue on to you.


On Fri, Jan 1, 2021 at 7:45 AM Christian Jullien <eligis@orange.fr> wrote:

First, happy new year all.


Porting tcc on *BSD systems raised issues/questions with stddef.h from tcc distrib.


First, it contains a mix of definitions coming from both stddef.h and stdint.h IMHO it should only contain what stddef.h is supposed to contain.

i.e. From C11:


B.18 Common definitions <stddef.h>






offsetof(type, member-designator)




Howerver it also contain many [u]intN_t type definitions which duplicate what is found on stdint.h


The issues come when a valid program frist includes <stdint.h> then <stddef.h>

It first finds [u]intN_t definitions in system [/usr/include/]stdint.h file which are duplicated/redefined in [tcc/include/]stddef.h from tcc.

When definitions differ, tcc stops as some with *BSD systems and [u]int64_t definitions.




Why tcc needs its own stddef.h instead of system one?

Why tcc does not need stdint.h?


I suppose it is because tcc does not support all gcc syntaxes found on stddef.h (is it still true?) in that case, it would be better to split definitions in stddef.h and stdint.h following the ISO C11 standard.


Clarifications/fixes are welcome.



Tinycc-devel mailing list

reply via email to

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