When setting compiler option for GNUARM we see a build error
-Werror=type-limits
This flag can be set in Commonconfig.cmake, example
set (COMMON_COMPILE_FLAGS -Werror=type-limits -fshort-enums -fshort-wchar -funsigned-char -msoft-float ${CMSE_FLAGS} -ffunction-sections -fdata-sections --specs=nano.specs)
Attestation Error
~/trusted-firmware-m/secure_fw/services/initial_attestation/attestation_core.c: In function 'attest_add_security_lifecycle_claim':
~/trusted-firmware-m/secure_fw/services/initial_attestation/attestation_core.c:716:28: error: comparison is always false due to limited range of data type [-Werror=type-limits]
if (security_lifecycle < TFM_SLC_UNKNOWN ||
Internal Trusted Storage Error
~/trusted-firmware-m/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.c: In function 'its_flash_fs_mblock_reset_metablock':
~/trusted-firmware-m/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.c:980:39: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
for (i = ITS_INIT_DBLOCK_START; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
~/trusted-firmware-m/secure_fw/services/internal_trusted_storage/flash_fs/its_flash_fs_mblock.c:994:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
for (i = 0; i < ITS_NUM_DEDICATED_DBLOCKS; i++) {
Protected Storage Error (SST)
~/trusted-firmware-m/secure_fw/services/secure_storage/flash_fs/sst_flash_fs_mblock.c: In function 'sst_flash_fs_mblock_reset_metablock':
~/trusted-firmware-m/secure_fw/services/secure_storage/flash_fs/sst_flash_fs_mblock.c:1043:39: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
for (i = SST_INIT_DBLOCK_START; i < SST_NUM_DEDICATED_DBLOCKS; i++) {
~/trusted-firmware-m/secure_fw/services/secure_storage/flash_fs/sst_flash_fs_mblock.c:1057:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
for (i = 0; i < SST_NUM_DEDICATED_DBLOCKS; i++) {