Vincent Lefevre writes:
> More than an order issue, this is undefined behavior. In C11:
>
> 5.1.2.4 Multi-threaded executions and data races
>
>4 Two expression evaluations conflict if one of them modifies a
> memory location and the other one reads or modifies the
Vincent Lefevre writes:
On 2018-03-12 18:53:37 +0100, Marco Bodrato wrote:
> double
> mpz_get_d (const mpz_t u)
> {
> static int c = 0;
> static int __initialized = 0;
>
> if (__initialized != 1) {
> c = gmp_tests_dbl_mant_bits ();
>
On 2018-03-13 13:55:27 +0100, Torbjorn Granlund wrote:
> Vincent Lefevre writes:
>
> On 2018-03-12 18:53:37 +0100, Marco Bodrato wrote:
> > double
> > mpz_get_d (const mpz_t u)
> > {
> > static int c = 0;
> > static int __initialized = 0;
> >
> > if
On 2018-03-13 15:12:27 +0100, Niels Möller wrote:
> Does C11 provide any way to initialize a local static variable, like in
> recent C++? I.e., not code running before main, but code running the
> first time the function is entered, and guaranteed to run just once?
I don't think so. 6.7.9p4 says
ni...@lysator.liu.se (Niels Möller) writes:
Does C11 provide any way to initialize a local static variable, like in
recent C++? I.e., not code running before main, but code running the
first time the function is entered, and guaranteed to run just once?
> I don't think volatile matters.
On Tue, 13 Mar 2018, Niels Möller wrote:
I'd still prefer the simpler way of reying on float.h constants,
though
+1 to that. For mini-gmp, maybe put all the functions using 'double'
behind some macro or in a separate file so it is easy for a user to remove
them, and document that they are
On 2018-03-13 15:34:26 +0100, Torbjorn Granlund wrote:
> ni...@lysator.liu.se (Niels Möller) writes:
> If we can make this thread safe with C11, I think it's fine to document
> that mini-gmp requires C11 for thread safety. (I'd still prefer the
> simpler way of reying on float.h constants,
On 2018-03-13 17:29:48 +0100, Marc Glisse wrote:
> +1 to that. For mini-gmp, maybe put all the functions using 'double' behind
> some macro or in a separate file so it is easy for a user to remove them,
> and document that they are only supported with a standard float.h header. Or
> just assume