[CLN-list] Question about compiler warning

Bruno Haible bruno at clisp.org
Sun Feb 25 21:58:44 CET 2018


Hi Jan,

> line 100:
> if (qx > (uintDD)(~x1)) {
> 
> The compiler tells me that after taking the bitwise complement of x1,
> the (uintDD) cast will extend x1 by adding zeros, which is probably not
> the intention?

When you compare this line with the corresponding line 285 (for platforms
without an uintDD type), you see that zero-extend is the intention here.

More generally, unsigned integer types and zero-extend are the natural
types/operations for the implementation of CLN. Signed integer types and
sign-extend are not used so frequently.

Bruno



More information about the CLN-list mailing list