Hello, On Mon, Mar 9, 2020 at 6:23 AM Marco Bodrato <bodr...@mail.dm.unipi.it> wrote: > > Ciao, > > Il 2020-03-07 21:27 minux ha scritto: > > All comments addressed, except as noted below. > > I also fixed similar issues in mini-mpq.c changes. > > > > On Sat, Mar 7, 2020 at 2:26 PM Niels Möller <ni...@lysator.liu.se> > > wrote: > >> minux <minux...@gmail.com> writes: > > >> I'm not that familiar with the mpq functions. I hope Marco can > >> comment. > > I had problems with my e-mail adress, but I'm here again :-) > > Maybe there are some unneeded initialisations = NULL, but details can > also be refined later... > > There is an undocumented "feature" that the proposed patch breaks: > "safe" failure when the base is out of range. > The question is, should we keep it or not, document it or not, should > GMP and mini-gmp agree? > > I attach a possible patch for tests that check that feature.
IMO, it's better to keep behavior of mini-gmp and gmp as consistent as possible, to minimize surprises. I added a check for out-of-range base to the beginning of mpq_get_str and incorporated your patch to the mini-gmp test (I didn't include the one in main gmp test suite though, as I think it's out of scope for this patch.) Please take another look at the attached patch. All existing comments addressed. Thanks.
mini-gmp.patch
Description: Binary data
_______________________________________________ gmp-devel mailing list gmp-devel@gmplib.org https://gmplib.org/mailman/listinfo/gmp-devel