Skip to content

bitWrite macro does not enclose argument in () #153

Closed
@positron96

Description

@positron96

#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))

Current version does not wrap arguments in "()", so it works incorrectly when used like this:

bitWrite(var, bit, cond?1:0);

Some cores probably copied this header, as seen in stm32 and esp32

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions