[build] address new warnings with clang-14 (#8924)

This commit adds two small changes to address new warnings when
building with clang-14.

It also updates `mbedtls` CMakeLists to set `MBEDTLS_FATAL_WARNINGS`
option as `OFF` (so that compiler warnings are not treated as errors).
This avoid issues with new warning for `unused-but-set-variable` emitted
by clang-14.
This commit is contained in:
Abtin Keshavarzian
2023-04-06 09:51:29 -07:00
committed by GitHub
parent b48544c3b8
commit 356b4a6a58
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ static uint16_t sRawPowerSettingLength = 0;
void otPlatDiagModeSet(bool aMode) { sDiagMode = aMode; }
bool otPlatDiagModeGet() { return sDiagMode; }
bool otPlatDiagModeGet(void) { return sDiagMode; }
void otPlatDiagChannelSet(uint8_t aChannel) { OT_UNUSED_VARIABLE(aChannel); }
+1 -1
View File
@@ -3574,7 +3574,7 @@ template <> otError Interpreter::Process<Cmd("eidcache")>(Arg aArgs[])
memset(&iterator, 0, sizeof(iterator));
for (uint8_t i = 0;; i++)
while (true)
{
SuccessOrExit(otThreadGetNextCacheEntry(GetInstancePtr(), &entry, &iterator));
OutputEidCacheEntry(entry);
+2
View File
@@ -45,6 +45,8 @@ find_program(SED_EXE sed)
string(REPLACE "-Wconversion" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "-Wconversion" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(MBEDTLS_FATAL_WARNINGS OFF CACHE BOOL "Compiler warnings treated as errors" FORCE)
add_subdirectory(repo)
if(UNIFDEFALL_EXE AND SED_EXE AND UNIFDEF_VERSION VERSION_GREATER_EQUAL 2.10)