• Rasmus Villemoes's avatar
    configurator: Fix CTZ detection · 1567e4bd
    Rasmus Villemoes authored
    The literal "1" in "1 << (sizeof(long{, long})*8 - 1)" should be 1L or
    1LL, so that the expression has the right type. Otherwise, the shift
    is only by 31 bits on x86 (other platforms may behave differently). To
    avoid language lawyers shouting UB at me, and since
    __builtin_ctz{,l,ll} formally takes unsigned parameters, use UL and
    ULL suffixes.
    
    Also, fix a typo (missing parenthesis) in the code for CTZLL causing
    the detection of __builtin_ctzll to always fail for the wrong reason.
    Signed-off-by: default avatarRasmus Villemoes <rv@rasmusvillemoes.dk>
    Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
    1567e4bd
configurator.c 17.4 KB