tinycc-devel
[Top][All Lists]
Advanced

[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: Joshua Scholar
Subject: Re: [Tinycc-devel] issues/questions with stddef.h which comes with tcc
Date: Fri, 1 Jan 2021 09:08:57 -0800

https://github.com/vnmakarov/mir

I mentioned all the sorts of things I wanted in a jit (along with saying that I could help) to the author of this jit and he said he wasn't interested. 
He doesn't particularly want to generate parallel friendly code, nor is he interested in a garbage collector, nor in making the state of a system open to snapshotting.

On Fri, Jan 1, 2021 at 8:27 AM Joshua Scholar <joshuascholar@gmail.com> wrote:
I had this experience the other day.
Someone on Github is building a (not yet finished) jit compiler that has a C compiler as a test case.  It will be a competitor to TCC one day, I guess.
Anyway, it's being developed on Linux but some early parts were tested on Windows.
Not the C compiler though, it doesn't come with ANY include files.
I tried MingW's include files - nothing but errors.
I tried TCC's include files - nothing but errors.

So that's an example of this sort of thing going wrong.

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>

ptrdiff_t

size_t

max_align_t

wchar_t

NULL

offsetof(type, member-designator)

_ _STDC_WANT_LIB_EXT1_ _

rsize_t

 

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.

 

Questions:

 

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.

 

C.

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

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