Subject: Re: bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

From: [email-masked] (Niels Möller)
Date: Fri, 07 Sep 2012 10:56:42 +0200

Torbjorn Granlund <[email-masked]> writes:

> There is one other place where some (hypothetical) portability problems
> may exist, and that's make-prime-list.c.  It prints a list of uintmax_t
> literals.

I don't think the prime sieving is not a problem, but for each (odd)
prime p, it also computes p^{-1} mod 2^{bits} and floor ( (2^{bits} - 1)
/ p), where "bits" is the size of an uintmax_t. This will break cross
compilation, if uintmax_t is of different size on build and host system,
or if different suffixes (U, UL, ULL) are needed in the generated
primes.h.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.