Hi there,
I see the following warning when compiling MQTT-TLS:
/Users/me/bestPrjEver/lib/MQTT-TLS/src/MQTT-TLS.cpp:
In member function 'MQTT::handShakeTls()':
/Users/me/bestPrjEver/lib/MQTT-TLS/src/MQTT-TLS.cpp:727:45:
warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
727 | } while (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE);
Here’s the function where this is happening:
int MQTT::handShakeTls() {
int ret;
debug_tls("hand shake start\n");
do {
while (ssl.state != MBEDTLS_SSL_HANDSHAKE_OVER) {
ret = mbedtls_ssl_handshake_client_step(&ssl);
if (ret != 0)
break;
}
} while (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE);
(... there is more code, not shown for convenience ...)
Now the question:
How bad is it on a Particle device when code potentially uses an uninitialized variable value?
I can file a PR in the lib, but I want to know if this is something to worry about, or safe to ignore.
FYI: @hirotakaster
Thanks!