Warnings with GMP.H

delta trinity deltatrinity at hotmail.com
Wed May 12 23:16:12 CEST 2004


Hello, I don't know if I should forward this to gmp-bugs...

Anyone noticed warnings when compiling with GMP.H 4.1.3?

I get:

- Condition is always true (line 1595)
- Negating unsigned value (line 1596)

in gmp.h

[...]
unsigned long
mpz_get_ui (mpz_srcptr __gmp_z) __GMP_NOTHROW
[...]
  if (__GMP_ULONG_MAX <= GMP_NUMB_MASK)               <-Condition is always 
true
    return __gmp_l & (-(mp_limb_t) (__gmp_n != 0));        <-Negating 
unsigned value
[...]

Well, those are simple warnings, which can probably be fixed by:
- Doing the if at compile time, i.e. #if (since the expression reffer to 
constants set at GMP-build time)
- Doing a bitwise 'not' or doing a conditional expresion, i.e.
return  (__gmp_n != 0)?__gmp_l :0;

Regards

Eric
deltatrinity at hotmail.com

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/



More information about the gmp-discuss mailing list