Skip to content

Conversation

positron96
Copy link
Contributor

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

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

Same as in here: espressif/arduino-esp32#4466

Current version does not wrap arguments in "()", so works incorrectly when used like this:
```
bitWrite(var, bit, cond?1:0);
```


Same as in here: espressif/arduino-esp32#4466
@fpistm fpistm self-requested a review August 24, 2021 08:24
@fpistm fpistm added enhancement New feature or request fix 🩹 Bug fix labels Aug 24, 2021
@fpistm fpistm added this to the 2.1.0 milestone Aug 24, 2021
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, even if I think value and bit does not need extra parenthesis anyway it is safe.

@fpistm
Copy link
Member

fpistm commented Aug 24, 2021

Hi @positron96,

thanks for this PR.
To go further, I would raised also an issue in the ArduinoCore-API:
https://github.com/arduino/ArduinoCore-API/blob/d06d9b27c9de71b871a6b80ca9bc67e5e7a6c603/api/Common.h#L68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix 🩹 Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants