Home My Page Projects MPFR
Summary Activity Forums Tracker Lists Tasks Docs News SCM Files

[#21762] __gmpfr_longdouble_volatile not defined when volatile not available

2019-05-24 03:04
Submitted by:
Michael Forney (mcf)
Assigned to:
Nobody (None)
Target Version:
__gmpfr_longdouble_volatile not defined when volatile not available

Detailed description
I got a linking error when building with a compiler without volatile support. It looks like the condition in src/volatile.c doesn't get triggered since float.h is not included beforehand.

I believe this issue was introduced in r10618 (https://gforge.inria.fr/scm/viewvc.php/mpfr?view=revision&revision=10618).

Attached is a patch fixing the issue.
Message  ↓
Date: 2019-05-24 21:44
Sender: Vincent Lefèvre

OK, closing. I'll fix the 4.0 branch too.

Date: 2019-05-24 19:32
Sender: Michael Forney

Yes, r13494 works for me. Thanks for the quick response!

Date: 2019-05-24 12:42
Sender: Vincent Lefèvre

In r13494, I've put the #include <float.h> in mpfr-impl.h to make sure that the related macro definitions are always correct. Then, one should be able to remove the occurrences from the .c files.

An alternative solution could be to make the <float.h> inclusion together with all definitions relative to native floating-point types conditional, and define a MPFR_NEED_NATIVE_FP in .c files when needed (e.g. get_d.c). But I don't think that this solution has a real practical interest (the idea behind that would be to make sure that native FP is used only for conversion functions with native FP types, but actually nothing prevents one from using native FP types anywhere, whether this macro is defined or not).

Date: 2019-05-24 09:06
Sender: Paul Zimmermann

please can you check revision 13494?

Date: 2019-05-24 07:47
Sender: Michael Forney

It is because https://gforge.inria.fr/scm/viewvc.php/mpfr/trunk/src/mpfr-impl.h?r1=10618&r2=10617&pathrev=10618 makes the definition of WANT_GMPFR_LONGDOUBLE_VOLATILE conditional on the definition of FLT_RADIX, which comes from float.h.

See https://gforge.inria.fr/scm/viewvc.php/mpfr/trunk/src/cmp_ld.c?r1=10613&r2=10612&pathrev=10613 for a similar change to make sure a different definition from the same section of mpfr-impl.h gets processed.

Date: 2019-05-24 07:35
Sender: Paul Zimmermann

I've applied the patch, but I wonder why including float.h makes a difference.

Size Name Date By Download
507 bytesmpfr-volatile.patch2019-05-24 03:04mcfmpfr-volatile.patch
Field Old Value Date By
status_idOpen2019-05-24 21:44vlefevre
close_dateNone2019-05-24 21:44vlefevre
ResolutionNone2019-05-24 21:44vlefevre
File Added6144: mpfr-volatile.patch2019-05-24 03:04mcf