#BL602 I2C HAL looks a little dubious... Why is there an Assignment inside a Condition? 🤔
https://github.com/bouffalolab/bl_iot_sdk/blob/master/components/hal_drv/bl602_hal/hal_i2c.c#L74-L95
@lupyuen Unless the right side is secretly a variable: because someone has been developing in C in hubris mode (aka "I don't need fatal warnings, I know what I'm doing").
@lupyuen @chrysn 
Yeah, it probably should be a "==", although I've often seen guys take advantage of the way "AND" conditionals are processed in order to assign variables (if the first condition is in not true, it won't bother to execute the second test and so the variable won't get assigned, but if the first condition is true the variable is assigned. It's bad form but seems to be accepted practice in some scripting languages.
@Pat @lupyuen I stand corrected: Neither gcc nor clang warn about this with -Werror -Wextra -pedantic. The needless parentheses hide the error (in a single statement there'd be a "warning: suggest parentheses around assignment used as truth value"), but nothing complains :-(