gmp_printf bug?

Torbjorn Granlund tg at
Thu Aug 11 09:37:01 CEST 2011

nisse at (Niels Möller) writes:

  The table is generated after ./configure, and before the files that go
  into libgmp are compiled (or at least, before any files which uses the
  table in question).
Indeed.  The file responsible is gen-bases.c.  It generates a C file
(mpn/mp_bases.c) and a header file (mp_bases.h).

  So the table generation should not depend on gmp, nor on mpfr. If I
  understand Torbjörn correctly, it should only use plain C, and the
  bignum functions defined in the file dumbmp.c (a subset of GMP's mpz
  interface, with a less sophisticated implementation).
It wuld of course be nice if we could have used mpfr, but that would
create an unpleasant bootstrap problem, with a circular depencency of
gmp on mpfr on gmp...

We are therefore limited to using dumbmp.c, which, as the name might
suggest, contains unsophisticated code.  It is written to be maximally
portble, not to be fast, so yes, it should remain in plain C.

(We actually had some performance issues with the new gen-bases.c, but
after I mplemented some of Niels' suggestions, it is now fast enough.)


More information about the gmp-devel mailing list