Some printf (PRI_XXX) are not portable
On FreeRTOS build there are some uild warnings due to mismatching print macro (PRI_XXX
or direct use of %xxx
) and actual parameter:
-
sopc_chunks_mgr.c:413
(+ same at lines 476 & 4391)
SOPC_Logger_TraceError(SOPC_LOG_MODULE_CLIENTSERVER,
"ChunksMgr (asym cert): sender certificate decoding error (epCfgIdx=%" PRIu32
" scCfgIdx=%" PRIu32 "): status=%" PRIX32,
epConfigIdx, scConfigIdx, status);
=> format '%lX' expects argument of type 'long unsigned int', but argument 5 has type 'int' [-Wformat=] sopc_chunks_mgr.c /S2OPC_demo_FreeRTOS/S2OPC/src/ClientServer/secure_channels line 414 C/C++ Problem
(Note that status is SOPC_ReturnStatus
, not uint32_t
.
message_in_bs.c:140
SOPC_Logger_TraceDebug(SOPC_LOG_MODULE_CLIENTSERVER,
"Services: decoded input message header statusCode= '%X'",
((OpcUa_ResponseHeader*) header)->ServiceResult);
=> format '%X' expects argument of type 'unsigned int', but argument 3 has type 'SOPC_StatusCode' {aka 'long unsigned int'} [-Wformat=] message_in_bs.c /S2OPC_demo_FreeRTOS/S2OPC/src/ClientServer/services/b2c line 140 C/C++ Problem
sopc_secure_connection_state_mgr.c:3715
SOPC_Logger_TraceDebug(SOPC_LOG_MODULE_CLIENTSERVER,
"ScStateMgr: SC_SERVICE_SND_ERR scIdx=%" PRIu32 " sc=%X reqId/Handle=%" PRIuPTR, eltId,
(SOPC_StatusCode) params, auxParam);
=> format '%X' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=] sopc_secure_connection_state_mgr.c /S2OPC_demo_FreeRTOS/S2OPC/src/ClientServer/secure_channels
libs2opc_server.c:147
SOPC_Logger_TraceWarning(SOPC_LOG_MODULE_CLIENTSERVER,
"- Writing runtime variable %s failed with status 0x%X", nodeIdStr,
writeResp->Results[i]);
=> format '%X' expects argument of type 'unsigned int', but argument 4 has type 'SOPC_StatusCode' {aka 'long unsigned int'} [-Wformat=]
-
message_out_bs.c:286
(idem)
SOPC_Logger_TraceDebug(SOPC_LOG_MODULE_CLIENTSERVER,
"Services: encoded output message type = '%s' with statusCode= '%X'",
SOPC_EncodeableType_GetName(encType),
((OpcUa_ResponseHeader*) message_out_bs__msg_header)->ServiceResult);
-
session_core_bs.c:284
(idem)
SOPC_Logger_TraceInfo(SOPC_LOG_MODULE_CLIENTSERVER,
"Services: session=%" PRIu32 " closed with bad status code '%X'",
session_core_bs__session, scReason);