Page 1 of 1

Uninitialized var request_id causing compiler failure for Release

Posted: Tue Feb 04, 2020 11:05 pm
by jsam589
I am using the ESP32 port of Azure SDK. I noticed this issue mentioned in several places for many months but it has never been put into the master branch.

In file azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c
a local variable on line 1496 size_t request_id;
is not initialized.

When building in Release configuration, the compiler treats as a fatal error on line 1518.

azure-iot-sdk-c/iothub_client/src/iothubtransport_mqtt_common.c:1518:32:
error: 'request_id' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Yes, I can edit this myself to set to 0, but I try to treat the Azure library as untouchable 3rd party code.

Can someone please check in the fix to the master branch?

Thanks!

Re: Uninitialized var request_id causing compiler failure for Release

Posted: Fri Feb 07, 2020 10:32 am
by ESP_Piyush
Since that code is part of an external codebase, we cannot change it as of now. However, we have aded a fix to suppress that error. Going ahead, when we move to a newer azure-iot-sdk-c , we will ensure that the error is fixed in the actual source itself.