Skip to content

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

Open

Description

@onlytheworld

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*/
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions