Polygeist icon indicating copy to clipboard operation
Polygeist copied to clipboard

[bug] Operations such as "|=", "&=" and "^=" lack necessary implicit type conversions

Open onlytheworld opened this issue 1 year ago • 0 comments

Operations such as "|=", "&=" and "^=" lack the necessary implicit type conversions, e.g. the following code will compile with the error "op requires the same type for all operands and results".

void setbit(char *set, int number, int value)
{
        set += number / CHAR_BIT;
        if (value)
                *set |= 1 << (number % CHAR_BIT);           /* set bit  */
        else    *set &= ~(1 << (number % CHAR_BIT));        /* clear bit*/
}

onlytheworld avatar Apr 13 '24 08:04 onlytheworld