Re: bug in gmp_fprintf still in next release?

2019-09-27 Thread paul zimmermann
> From: t...@gmplib.org (Torbjörn Granlund)
> Date: Fri, 27 Sep 2019 14:06:34 +0200
> 
> Marc Glisse  writes:
> 
>   The report was also about mpz_get_str, which does not have this
>   limitation. And for printf, it should be possible to make it print
>   correctly and return a nonsense integer.
> 
> Maybe.
> 
> But we cannot make %* type arguments work, easily.  It will be limping
> unless we change int to size_t (or some such).

it would be a great progress if the limits of mpz_get_str/mpz_set_str were
raised, and if the limitations of gmp_*printf (if any) were documented.

Paul
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: bug in gmp_fprintf still in next release?

2019-09-27 Thread Torbjörn Granlund
Marc Glisse  writes:

  The report was also about mpz_get_str, which does not have this
  limitation. And for printf, it should be possible to make it print
  correctly and return a nonsense integer.

Maybe.

But we cannot make %* type arguments work, easily.  It will be limping
unless we change int to size_t (or some such).

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: bug in gmp_fprintf still in next release?

2019-09-27 Thread Marc Glisse

On Fri, 27 Sep 2019, Torbjörn Granlund wrote:


paul zimmermann  writes:

 four years ago [1] I reported an issue with gmp_fprintf in GMP 6.1.0,
 which cannot print correcly a number of 8589934589 bits (less than 2^33).

 I just checked with today's snapshot: the issue is still there.

Yikes!

 Will the next GMP release be still limited to less than 2^33 bits?

Probably.

I believe the issue is the printf family's use of 'int' for sizes.  We
cannot really get around that in gmp_*printf* while staying compatible.
(I assume it was poor design by us in the first place not to use some
wider signed type.)


The report was also about mpz_get_str, which does not have this 
limitation. And for printf, it should be possible to make it print 
correctly and return a nonsense integer.


--
Marc Glisse
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: bug in gmp_fprintf still in next release?

2019-09-27 Thread Torbjörn Granlund
paul zimmermann  writes:

  four years ago [1] I reported an issue with gmp_fprintf in GMP 6.1.0,
  which cannot print correcly a number of 8589934589 bits (less than 2^33).

  I just checked with today's snapshot: the issue is still there.

Yikes!

  Will the next GMP release be still limited to less than 2^33 bits?

Probably.

I believe the issue is the printf family's use of 'int' for sizes.  We
cannot really get around that in gmp_*printf* while staying compatible.
(I assume it was poor design by us in the first place not to use some
wider signed type.)

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs