Re: 6.2.0 build failure on x86_64 Skylake PC - FIX

2020-11-10 Thread Marco Bodrato

Il 2020-06-08 21:52 Marc Glisse ha scritto:

[handle *-*-msys exactly the same as *-*-mingw* in configure.ac]



configfsf.guess does mention a triple *-pc-msys, so I guess it makes
sense to handle it (or replace it with something we already handle). I
don't really know in what ways it differs from mingw, probably not
that much as far as GMP is concerned.


To build and test a static library, this seems enough.

A test with
./configure --enable-cxx&& check& check-mini-gmp
worked smoothly.


I notice in a generated file:

aclocal.m4:  *-*-mingw* ) # actually msys

Should automake also be taught about the msys triple?


You are right. If I understand it correctly, automake does not know how 
to build shared libraries under *-pc-msys. So that ./configure 
--enable-shared --disable-static outputs


checking if libtool supports shared libraries... no
checking whether to build shared libraries... no

and then make check fails.


But msys and mingw are somehow different wrt shared libraries...
./configure --build=$(./config.guess|sed 's/-msys/-mingw64/') 
--enable-shared
builds a library that passes "make check-mini-gmp" but the Makefiles are 
not able to build the tests for "make check"...


It would be nice to know if there are other libraries using the 
autotools that build a shared dll under msys...


Ĝis,
m
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: with strict C99 the tests/mpz/convert.c needs #include

2020-11-10 Thread Vincent Lefevre
On 2020-11-09 10:14:37 +0100, Torbjorn Granlund wrote:
> Vincent Lefevre  writes:
> 
>   In the context of the call, the values will always be nonnegative
>   so that this is OK, but there is a risk that some future developer
>   might reuse this function in another context, where it would be
>   incorrect on platforms with signed char (in particular, there is
>   no warning in the comment).
> 
> Perhaps we could rename this function
> note_that_this_funtion_is_called_str_casecmp_and_not_strcasecmp, to
> avoid such looming disaster?  Or, to be more polite, perhaps
> please_note_that_this_funtion_is_called_str_casecmp_and_not_strcasecmp?

Since GMP developers are so smart, why does the test exist anyway?
Since GMP is expected to return the correct answer, it is not needed
to do the test.

Seriously, this function is used in a context to test the result of
mpz_get_str, and it is better to assume any kind of bug (which could
come from GMP or the compiler, for instance). In particular, do not
assume that the string returned by mpz_get_str necessarily consists
of valid digits. The consequence of a bug might be that some memory
location in the string is an invalid digit or is not explicitly set.
If this happens, the test tolower (c1) != tolower (c2) may be false
in such a case, so that the error may remain undetected. Something
like

  if (c1 < 0 || c2 < 0)
abort ();

would improve the test.

Moreover, there's something I don't understand. In the test,

   base = bsi % 62 + 1;

so that the base may be larger or equal to 37, but in such bases,
the case is significant, but it is not tested. I mean that with the
current test, you won't be able to distinguish "1a" from "1A".

-- 
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