tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] many test errors on RPi (incl. core dump) after recen


From: Christian JULLIEN
Subject: Re: [Tinycc-devel] many test errors on RPi (incl. core dump) after recent changes
Date: Mon, 24 Jul 2017 07:40:39 +0200 (CEST)

Thanks, all is fine now on RPi.


About static in libs, YES! 1000 * YES, this is a vey bad idea.

It prevents to work with threads unless you add expensive mutex. More annoying, you have to know which functions use static in order to add mutex.


Over the time, standard C lib moved non MT-Safe functions, like rand, to their '_r' counterparts (rand_r).


The only acceptable use of static is for function clearly marked as non-MT-Safe.


Please note that this goes beyond 'static global'. For the same reason it also applies to local static.



Le : 23 juillet 2017 à 21:31 (GMT +02:00)
De : "grischka" <address@hidden>
À : "Christian JULLIEN" <address@hidden>, "address@hidden" <address@hidden>
Objet : Re: [Tinycc-devel] many test errors on RPi (incl. core dump) after recent changes


Christian JULLIEN wrote:
> many test errors on RPi (incl. core dump) after recent changes
> -
> Test: 22_floating_point...
> Bus error

OK, thanks. Might work again.

I also committed some change that makes -DONE_SOURCE the default
now. In combination with another addition that sets the default
native TCC_TARGET_... in tcc.h this is meant to make compiling a
tcc simple again as in

gcc tcc.c -o tcc (-ldl)

Sort of a movement back to the roots, if you want to ;)

As to the bitfields, it looks like this gcc (on arm/RPi) ignores
#pragma pack(1) altogether if it sees any zero-bits-field (int:0)
in the struct. Just another detail anyway.

As to
static int counter;
Michael, what can I do to convince you that static locals are most
likely always not a good idea in (lib)tcc ;)

--- grischka

reply via email to

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