Skip to content
  • Alan Coopersmith's avatar
    Use unsigned ints when shifting to create bitmasks · 299c9762
    Alan Coopersmith authored
    
    
    symbols.c:1057:28: portability: Shifting signed 32-bit value by 31 bits
      is implementation-defined behaviour. See condition at line 1049.
      [shiftTooManyBitsSigned]
            radio_groups |= (1 << (tmp.uval - 1));
                               ^
    symbols.c:1049:41: note: Assuming that condition 'tmp.uval>32' is not redundant
            if ((tmp.uval < 1) || (tmp.uval > XkbMaxRadioGroups))
                                            ^
    symbols.c:1057:28: note: Shift
            radio_groups |= (1 << (tmp.uval - 1));
                               ^
    symbols.c:1057:28: warning: Either the condition 'tmp.uval>32' is redundant
      or there is signed integer overflow for expression '1<<(tmp.uval-1)'.
      [integerOverflowCond]
            radio_groups |= (1 << (tmp.uval - 1));
                               ^
    symbols.c:1049:41: note: Assuming that condition 'tmp.uval>32' is not redundant
            if ((tmp.uval < 1) || (tmp.uval > XkbMaxRadioGroups))
                                            ^
    symbols.c:1057:28: note: Integer overflow
            radio_groups |= (1 << (tmp.uval - 1));
                               ^
    
    Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    299c9762