Hello Michael,

Your patch gives many new warnings when I do a reproducible tcc build on
Windows (i.e. tcc is first compiled by Cygwin/gcc then it is used to produce
a native Windows tcc binary - see https://sourceforge.net/projects/wintcc/).

 

Bootstrapping 32bits and 64bits tools with gcc -m64

Building lib/libtcc1-32.a with tcc -m32

In file included from lib/crt1.c:7:

In file included from ./include/winapi/windows.h:66:

In file included from ./include/winapi/windef.h:122:

./include/winapi/winnt.h:1493: warning: static storage ignored for
redefinition of 'GetCurrentFiber'

In file included from lib/crt1.c:7:

In file included from ./include/winapi/windows.h:66:

In file included from ./include/winapi/windef.h:122:

./include/winapi/winnt.h:1501: warning: static storage ignored for
redefinition of 'GetFiberData'

In file included from lib/crt1.c:8:

./include/stdio.h:259: warning: static storage ignored for redefinition of
'vsnprintf'

In file included from lib/crt1.c:9:

./include/stdlib.h:309: warning: static storage ignored for redefinition of
'_Exit'

In file included from lib/crt1.c:9:

./include/stdlib.h:561: warning: static storage ignored for redefinition of
'atoll'

In file included from lib/crt1.c:9:

./include/stdlib.h:562: warning: static storage ignored for redefinition of
'lltoa'

In file included from lib/crt1.c:9:

./include/stdlib.h:563: warning: static storage ignored for redefinition of
'ulltoa'

In file included from lib/crt1.c:9:

./include/stdlib.h:564: warning: static storage ignored for redefinition of
'wtoll'

In file included from lib/crt1.c:9:

 

... and many more! 

 

But, more annoying it now terminates with:

 

./include/winapi/winnt.h:1141: error: 'ExChange' undeclared

make: *** [Makefile:90: lib/libtcc1-64.a] Error 1

 

-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org]
On Behalf Of Michael Matz
Sent: Monday, June 17, 2019 05:46
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] minor patches + standard compliant inline
functions

 

Hello Petr,

 

On Tue, 11 Jun 2019, Petr Skočík wrote:

 

> - turn -fdollars-in-identifiers on by default        (gcc/clang do it too)

> - in c11 mode, skip __STDC_ISO_10646__         (was causing a redefinition

> warning in simple hello world programs compiled on linux with 

> -std=c11)

> - make -h|-hh succeed if the output is successfully written

> 

> are small and should be noncontroversial.

 

Nice.

 

> The issue was that tinycc's implementation of non-static inline 

> functions was very much nonconforming in terms of when visible symbols 

> would or would not be created.

 

Well, it was conforming (roughly), just not to ISO-C99, but rather to GNU C,
which had inline long before ISO C ;-)

 

> By looking at the at the mailing list archive, it looks like it was 

> discussed in 2013 but nothing was done about it.

> 

> The supplied patch should be fixing it.

 

Thanks for that, hopefully meanwhile most code in the wild will not rely on
gnu-inline behaviour anymore, but rather on c99 inline behaviour.  I've
taken up your remark in the patch about needing two new flags in type.t and
have rewritten that part.

 

FWIW, mingw still requires gnu-inline behaviour, which is why their use of
"extern inline" in __CRT_INLINE is correct for them (they force this
behaviour via an attribute), but with this TCC change 'static inline' is
more correct, though in reality it's even more complicated: it should be
"inline" only (without extern/static) and then some C file within mingw
would declare all these inlines as 'extern' as well, to ensure an external
definition exists.  Of course we can't influence mingw in this way, so
"static inline" is the correct equivalent to gnu-inline "extern inline".

 

And Christian: we shouldn't worry about changes in _mingw.h: that header
explicitely does _not_ come from Mingw32 as is but is private to TCC, so
differences are expected (and already exist).

 

 

Ciao,

Michael.

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

Reply via email to