tomsfastmath/src
Sebastian Andrzej Siewior 5d83c4e5ab tfm: use unsigned int for fp_digit on !FP_64BIT
There is a bugzilla entry at clamav [0] reports a problem on s390x
  "mul/fp_mul_comba_20.c:91: warning: right shift count >= width of type"
because fp_digit is 64bit and according to the comment it should be
smaller.
s390x is 64bit platform i.e. long and long long are both 64bit. The
same is true for ppc64, arm64 or sparc64 (RIP alpha).

The headerfile seems only to define FP_64BIT on x86_64.
The current code seems to define SIZEOF_FP_DIGIT either to 8 (64bit) or
to 4 in the else case and 4 looks like int and not long. Therefore the
change here.

If this change makes no sense and you would prefer to use something like
    #if __SIZEOF_LONG__ == 8
       #define FP_64BIT
    #endif

to autodetect a 64bit platform then we could try do this instead. I
haven't tested this patch nor verified that the problem still occures.

If you have no obvious solution and would like to have a confirmation
that this patch solves a problem I could try to get my hands on
something not x86 with 64bit in order to verify.

[0] https://bugzilla.clamav.net/show_bug.cgi?id=9017

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:22:35 +02:00
..
addsub s_fp_add: completely init c after add 2015-04-25 14:22:34 +02:00
bin fp_toradix_n: make sure too small strings are recognized 2015-04-25 14:22:34 +02:00
bit added tomsfastmath-0.12 2010-07-22 10:06:30 +02:00
divide added tomsfastmath-0.12 2010-07-22 10:06:30 +02:00
exptmod added tomsfastmath-0.12 2010-07-22 10:06:30 +02:00
generators mul generator: update preamble not to compile the code if it's not required 2014-06-12 18:08:34 +02:00
headers tfm: use unsigned int for fp_digit on !FP_64BIT 2015-04-25 14:22:35 +02:00
misc fp_ident: fix incorrect length in strncat() call. 2015-04-25 14:22:34 +02:00
mont ppc32: fix fp_montgomery_reduce assembly 2015-04-17 10:18:45 +10:00
mul fix compile errors 2015-02-15 14:50:20 +01:00
numtheory fp_prime_random_ex: make sure call-back function is not NULL 2014-10-13 16:51:13 +02:00
sqr fix compile errors 2015-02-15 14:50:20 +01:00