Unit Test Building Failing on Ubuntu 22.04
RLeclair opened this issue · 1 comments
Describe the bug
Unit test building failing at azure-sdk-for-c/sdk/inc/azure/core/_az_cfg.h while building the az_iot_provisioning_client tests due to the AZ_DEPRECATED macro. The use of '[[]]' is not supported in version 22.04 of Ubuntu using gcc version 11.3.0.
Exception or Stack Trace
[ 43%] Building C object sdk/src/azure/iot/CMakeFiles/az_iot_provisioning.dir/az_iot_provisioning_client.c.o
In file included from /home//azure-sdk-for-c/sdk/inc/azure/core/_az_cfg_prefix.h:29,
from /home//azure-sdk-for-c/sdk/inc/azure/core/az_result.h:21,
from /home//azure-sdk-for-c/sdk/inc/azure/core/az_json.h:19,
from /home//azure-sdk-for-c/sdk/src/azure/iot/az_iot_provisioning_client.c:4:
/home//azure-sdk-for-c/sdk/inc/azure/core/_az_cfg.h:97:23: error: ISO C does not support ‘[[]]’ attributes before C2X [-Werror=pedantic]
97 | #define AZ_DEPRECATED [[deprecated]]
| ^
/home//azure-sdk-for-c/sdk/inc/azure/iot/az_iot_provisioning_client.h:542:1: note: in expansion of macro ‘AZ_DEPRECATED’
542 | AZ_DEPRECATED AZ_NODISCARD az_result az_iot_provisioning_client_get_request_payload(
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
gmake[2]: *** [sdk/src/azure/iot/CMakeFiles/az_iot_provisioning.dir/build.make:76: sdk/src/azure/iot/CMakeFiles/az_iot_provisioning.dir/az_iot_provisioning_client.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:340: sdk/src/azure/iot/CMakeFiles/az_iot_provisioning.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2
To Reproduce
Follow steps to run unit tests in repo:
- Run the unit tests on Ubuntu 22.04
Code Snippet
#define AZ_DEPRECATED [[deprecated]]
Expected behavior
I expected the tests to be built successfully.
Setup (please complete the following information):
- OS: Ubuntu 22.04
- gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Information Checklist
Please make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [*] Bug Description Added
- [*] Repro Steps Added
- [*] Setup information Added
Kudos for the level of description! Really good.