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

2020-11-08 Thread Marco Bodrato

Ciao,

Il 2020-11-08 00:45 Dennis Clarke ha scritto:

However the tests blow up due to :

convert.c:143:11: error: implicit declaration of function 'strcasecmp'
is invalid in C99


That file will be changed in the next release. Please look if the 
applied patch fits your needs.

https://gmplib.org/repo/gmp-6.2/rev/ad3ca09cfa38

Ĝ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-08 Thread Vincent Lefevre
On 2020-11-07 18:45:52 -0500, Dennis Clarke wrote:
> However the tests blow up due to :
> 
> convert.c:143:11: error: implicit declaration of function 'strcasecmp'
> is invalid in C99
> 
> So that is easy to fix.
> 
> ijiraq# diff -u ./tests/mpz/convert.c.orig ./tests/mpz/convert.c
> --- ./tests/mpz/convert.c.orig  2020-01-17 13:44:49.0 +
> +++ ./tests/mpz/convert.c   2020-11-07 22:51:36.823215000 +
> @@ -21,6 +21,7 @@
>  #include 
>  #include 
>  #include  /* for strlen */
> +#include  /* for strcasecmp */
> 
>  #include "gmp-impl.h"
>  #include "tests.h"
> ijiraq#

strcasecmp is not part of C99. It should be better to convert both
strings to uppercase (with toupper) or lowercase (with tolower),
then do a usual comparison.

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