Warnings with GMP.H

Kevin Ryde user42 at zip.com.au
Sat May 15 01:59:40 CEST 2004


"delta trinity" <deltatrinity at hotmail.com> writes:
>
> Hello, I don't know if I should forward this to gmp-bugs...

Yes.  (The headers are supposed to be clean to sensible application
usages.)

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

You have to say what compiler, what version, and what options.

> - Doing the if at compile time, i.e. #if (since the expression reffer
> to constants set at GMP-build time)

Yes some sort of preprocessor trickery would be possible (whether a
limb is a long or longlong, and how many nail bits).

> - Doing a bitwise 'not' or doing a conditional expresion, i.e.
> return  (__gmp_n != 0)?__gmp_l :0;

Actually I've changed to just that in the development code because I
thought it clearer than the mask and better for optimization (more
obvious cmov or predicate), though in fact gcc spits out the same for
both when I tried it.


More information about the gmp-discuss mailing list