bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Niels Möller
Subject: bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)
Date: Fri, 07 Sep 2012 10:56:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v)

Torbjorn Granlund <address@hidden> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]