support
support copied to clipboard
[Bug] Fix some errors not caught on embedded builds
I made this mistake earlier today:
pbio_error_t err;
while (pbio_port_get_servo(port, &type_id, &self->srv) == PBIO_ERROR_AGAIN) {
mp_hal_delay_ms(1);
}
pb_assert(err);
Which should have been:
pbio_error_t err;
while ((err = pbio_port_get_servo(port, &type_id, &self->srv)) == PBIO_ERROR_AGAIN) {
mp_hal_delay_ms(1);
}
pb_assert(err);
This raises the correct warning as error when building virtualhub but still passed on embedded hubs.
error: ‘err’ may be used uninitialized [-Werror=maybe-uninitialized]
We might be missing other warnings, so it would be good to make the embedded builds equally strict.