diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-03-29 14:39:22 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-03-29 14:39:22 +0000 |
commit | 2fd87b60186385c3d19446d39d6d610b33e3e076 (patch) | |
tree | 5988ae8c88a34b00c09bd92a1e0ea57e26020b8b /doc/README.dev | |
parent | 2cb68bb1c40eb69e96f00858812c8f52f446f6ea (diff) | |
download | mpfr-2fd87b60186385c3d19446d39d6d610b33e3e076.tar.gz |
Cleanup / fixes related to intmax_t, mpfr_intmax_t, etc.
The issues were:
* The build of the tests (make check) could fail with CFLAGS implying
"-std=c90 -Werror=format", i.e. if intmax_t was available but the
use of the "j" printf length modifier made the compilation fail
(its unconditional use was incorrect anyway).
* MPFR_INTMAX_MAX had definitions in both mpfr-impl.h & mpfr-intmax.h,
with inconsistent usage.
Detailed changes:
* acinclude.m4: removed the definition of MPFR_PRINTF_MAXLM, which
could be incorrect (large numbers were not tested to select its
value); in the MPFR_FUNC_GMP_PRINTF_SPEC macro, check sprintf()
in addition to gmp_sprintf() as it is now also used in the tests;
updated some comments and messages.
* src/mpfr-impl.h: removed the MPFR_*INTMAX* definitions; they had
been added due to
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582698
with -ansi -pedantic-errors, but this issue was fixed in GCC 4.8
(released 6 years ago), so that they are no longer needed.
* src/mpfr-intmax.h: completed the definitions; mpfr_intmax_t is now
the largest integer type available and fully working (in particular
with printf), thus it may be smaller than intmax_t.
* doc/README.dev: updated the description of mpfr_intmax_t, etc.
* tests/tversion.c: output sizeof(mpfr_intmax_t) too.
* Various .c files in src and tests related to (u)intmax_t: use
INTMAX_MAX instead of MPFR_INTMAX_MAX, etc. as Debian bug 582698
(mentioned above) no longer occurs and mpfr_intmax_t may be smaller
than intmax_t; use the "j" printf length modifier instead of
MPFR_PRINTF_MAXLM, and protect it with "#ifndef NPRINTF_J"
(only the tests are concerned, so that this is not an issue).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13457 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'doc/README.dev')
-rw-r--r-- | doc/README.dev | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/doc/README.dev b/doc/README.dev index 85c8c9b2c..9fe4d4173 100644 --- a/doc/README.dev +++ b/doc/README.dev @@ -1168,21 +1168,18 @@ array of bits (e.g. for limbs) and to temporarily avoid integer overflow. =========================================================================== -To use the features related to intmax_t, "mpfr-intmax.h" must be included -before "mpfr-impl.h", to express the need for the largest integer types. -Then, these features can be used only if _MPFR_H_HAVE_INTMAX_T is defined. -In such a case, do not use the macros UINTMAX_MAX, INTMAX_MAX and INTMAX_MIN -directly (because they might make the compilation fail due to bugs in the -build environment), but the MPFR versions: MPFR_UINTMAX_MAX, MPFR_INTMAX_MAX -and MPFR_INTMAX_MIN. Whether _MPFR_H_HAVE_INTMAX_T is defined or not, these -macros and the types mpfr_intmax_t / mpfr_uintmax_t are always defined, and -they correspond to the latest integer types available (e.g. intmax_t, else -long long, else long). - -It can be assumed that any signed (resp. unsigned) integer type can be -represented in mpfr_intmax_t (resp. mpfr_uintmax_t). - -The corresponding length specifier is MPFR_INTMAX_FSPEC. +To use features related to types larger than type long, "mpfr-intmax.h" +must be included before "mpfr-impl.h". + +The intmax_t and uintmax_t types can be used only if _MPFR_H_HAVE_INTMAX_T +is defined. In this case, the printf / gmp_printf length specifier "j" can +be used only when NPRINTF_J is not defined. + +For internal use, mpfr-intmax.h also unconditionally defines mpfr_intmax_t, +mpfr_uintmax_t, MPFR_UINTMAX_MAX, MPFR_INTMAX_MAX, MPFR_INTMAX_MIN and +the corresponding length specifier MPFR_INTMAX_FSPEC. + +Warning! mpfr_intmax_t may be smaller than intmax_t if NPRINTF_J is defined. =========================================================================== |