bug in __gmp_replacement_vsnprintf

2022-10-12 Thread Paul Zimmermann
   Hi,

[for the record, this issue was originally reported on the MPFR list:
https://sympa.inria.fr/sympa/arc/mpfr/2022-10/msg1.html]

Originally, it appeared only under Windows with the clang compiler,
and using MPIR, but I can reproduce it under Linux with GMP 6.2.1:

1) configure GMP
2) uncomment the #define HAVE_VSNPRINTF 1 line in config.h
3) build GMP
4) run the MPFR tsprintf test file with the built GMP

The issue is because __gmp_replacement_vsnprintf does not deal with %a not %A.
Then when calling gmp_printf ("%a", -1.25) for example, we get total_width=3
initially, we jump to the 'default' case, where the ASSERT(0) does nothing
in production code, and we go to next, where width=0 and prec=6, thus
total_width is increased to 9. But we also have len=9 because
buf='-0x1.4p+0'. Then the assertion ASSERT_ALWAYS (len < total_width) fails.

Paul

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


use of emphasize for math in the HTML GMP manual

2022-10-12 Thread Vincent Lefevre
GMP currently uses emphasize for math in the HTML GMP manual,
via @math{...} (and MPFR has copied to it). For instance, for
mpz_mul_2exp, one has "Set rop to op1 times 2 raised to op2." where
the whole "op1 times 2 raised to op2" is emphasized, i.e. typically
rendered in italics (or with a different color with lynx).

While I agree that variables should be in italics (@var ensures
that), having full text about math in italics seems wrong.

Or this should be fixed on the texinfo side (I really don't know
why it uses ):

  https://lists.gnu.org/archive/html/bug-texinfo/2022-10/msg00045.html

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs