[build] add format-nonliteral to missed code (#12251)

This commit enables the format-nonliteral check for code missed in
`#12236`. This commit also enables the format-nonliteral warnings in
CMake to catch such warnings in future in CMake build.
This commit is contained in:
Yakun Xu
2026-01-06 14:53:38 -08:00
committed by GitHub
parent bcc41e9b44
commit 31631142c2
25 changed files with 104 additions and 58 deletions
+4
View File
@@ -47,6 +47,10 @@ if(OT_RTT_UART)
)
endif()
target_compile_options(openthread-platform-utils PRIVATE
${OT_CFLAGS}
)
target_include_directories(openthread-platform-utils PRIVATE
${OT_PUBLIC_INCLUDES}
$<TARGET_PROPERTY:ot-config,INTERFACE_INCLUDE_DIRECTORIES>
+2 -1
View File
@@ -124,7 +124,8 @@ void utilsLogRttDeinit(void);
* @param[in] aFormat A pointer to the format string.
* @param[in] ap va_list matching information for aFormat
*/
void utilsLogRttOutput(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list ap);
void utilsLogRttOutput(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list ap)
OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK(3, 0);
#ifdef __cplusplus
} // extern "C"
+1 -1
View File
@@ -383,6 +383,7 @@ void otMacFrameUpdateTimeIe(otRadioFrame *aFrame, uint64_t aRadioTime, otRadioCo
uint8_t *timeIe;
uint64_t time;
OT_UNUSED_VARIABLE(aRadioContext);
VerifyOrExit((aFrame->mInfo.mTxInfo.mIeInfo != nullptr) && (aFrame->mInfo.mTxInfo.mIeInfo->mTimeIeOffset != 0));
timeIe = aFrame->mPsdu + aFrame->mInfo.mTxInfo.mIeInfo->mTimeIeOffset;
@@ -434,7 +435,6 @@ bool otMacFrameSrcAddrMatchCslReceiverPeer(const otRadioFrame *aFrame, const otR
break;
case Mac::Address::kTypeExtended:
VerifyOrExit(*reinterpret_cast<const uint64_t *>(aRadioContext->mCslExtAddress.m8) != 0);
VerifyOrExit(src.GetExtended() == *static_cast<const Mac::ExtAddress *>(&aRadioContext->mCslExtAddress));
matches = true;
break;
+5 -1
View File
@@ -43,6 +43,10 @@ using namespace ot;
#if OPENTHREAD_CONFIG_OTNS_ENABLE
OT_TOOL_WEAK
void otPlatOtnsStatus(const char *aStatus) { LogAlways("[OTNS] %s", aStatus); }
void otPlatOtnsStatus(const char *aStatus)
{
OT_UNUSED_VARIABLE(aStatus);
LogAlways("[OTNS] %s", aStatus);
}
#endif // OPENTHREAD_CONFIG_OTNS_ENABLE