mpz_array_init warnings

yugyo yugyo at yahoo.fr
Mon Apr 9 18:40:13 CEST 2007


I think you'd better to this first:
mpz_t  olda [cnt];

or I think you forget the [0] in one ligne:
mpz_array_init(olda[0], cnt, nbits);

++


John Tromp wrote:
> 
> dear GMP experts,
> 
> I have a piece of code:
> 
>   mpz_t *olda, *newa;
>                                                                                 
>   olda = (mpz_t *)calloc(cnt, sizeof(mpz_t));
>   assert(olda != NULL);
>   printf("allocated space for %d references of size %d\n", cnt,
> sizeof(mpz_t));
>   mpz_array_init(olda, cnt, nbits);
> 
> that gives me the following warnings
> 
> legal.c:30: warning: passing arg 1 of `__gmpz_array_init' from
> incompatible pointer type
> 
> Yet the documentation states the type of the first argument as mpz_t[].
> Isn't that the same as *mpz_t?
> 
> How do I get rid of these warnings?
> 
> I cannot declare olda as an array since I compute its size dynamically
> and it can be 100s of millions of entries long...
> 
> regards,
> 
> %!PS                       %  -John Tromp (http://www.cwi.nl/~tromp/)
> 42 42 scale 7 9 translate .07 setlinewidth .5 setgray/c{arc clip fill
> setgray}def 1 0 0 42 1 0 c 0 1 1{0 3 3 90 270 arc 0 0 6 0 -3 3 90 270
> arcn 270 90 c -2 2 4{-6 moveto 0 12 rlineto}for -5 2 5{-3 exch moveto
> 9 0 rlineto}for stroke 0 0 3 1 1 0 c 180 rotate initclip}for showpage
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at swox.com
> https://gmplib.org/mailman/listinfo/gmp-discuss
> 
> 

-- 
View this message in context: http://www.nabble.com/mpz_array_init-warnings-tf79891.html#a9905336
Sent from the Gnu - GMP - Discuss mailing list archive at Nabble.com.



More information about the gmp-discuss mailing list