From 062e67ced63fcc42556e9ca0bf3cf37d0cf4de33 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 9 Jul 2021 12:08:26 -0400 Subject: [PATCH] Add ci for disabled progress logging (#8239) * Add CI for disabling progress logging. This requires fixing the build failures when progress logging is disabled * Regenerate generated files --- .github/workflows/build.yaml | 3 +- .../gen/IMClusterCommandHandler.cpp | 72 +++++++++++++++++ .../gen/IMClusterCommandHandler.cpp | 24 ++++++ examples/bridge-app/linux/main.cpp | 3 + .../gen/IMClusterCommandHandler.cpp | 28 +++++++ .../gen/IMClusterCommandHandler.cpp | 20 +++++ .../pump-common/gen/CHIPClientCallbacks.cpp | 40 +++++++++- .../gen/IMClusterCommandHandler.cpp | 28 +++++++ .../gen/CHIPClientCallbacks.cpp | 40 +++++++++- .../gen/IMClusterCommandHandler.cpp | 20 +++++ .../main/gen/IMClusterCommandHandler.cpp | 16 ++++ .../tv-common/gen/IMClusterCommandHandler.cpp | 80 +++++++++++++++++++ .../common/gen/IMClusterCommandHandler.cpp | 16 ++++ .../app/CHIPClientCallbacks-src.zapt | 40 +++++++++- .../app/im-cluster-command-handler.zapt | 4 + .../data_model/gen/CHIPClientCallbacks.cpp | 40 +++++++++- .../gen/IMClusterCommandHandler.cpp | 64 +++++++++++++++ src/lib/support/PrivateHeap.cpp | 5 +- 18 files changed, 522 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 86f382d23a0b06..f80ddca9605db7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,8 +30,7 @@ jobs: strategy: matrix: - type: [gcc_debug, gcc_release, clang, mbedtls, clang_experimental, no_detail_logging] - # Disabling progress logging does not compile yet. Once it does, we can add the no_progress_logging type. + type: [gcc_debug, gcc_release, clang, mbedtls, clang_experimental, no_detail_logging, no_progress_logging] env: BUILD_TYPE: ${{ matrix.type }} DETAIL_LOGGING: ${{ matrix.type != 'no_detail_logging' && matrix.type != 'no_progress_logging' }} diff --git a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp index 82717af09c0512..b797fd78cc7a90 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp @@ -147,6 +147,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -196,6 +200,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -387,6 +395,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1862,6 +1874,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1982,6 +1998,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3389,6 +3409,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3585,6 +3609,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3951,6 +3979,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4063,6 +4095,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4177,6 +4213,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4707,6 +4747,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4762,6 +4806,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5451,6 +5499,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5733,6 +5785,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5800,6 +5856,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -6307,6 +6367,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -6808,6 +6872,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -6875,6 +6943,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp index fc432b8ce06ea7..d38073cab002f5 100644 --- a/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp +++ b/examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp @@ -153,6 +153,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -349,6 +353,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -879,6 +887,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1568,6 +1580,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1635,6 +1651,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2142,6 +2162,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 9fde456358579f..546a660635f80e 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -173,6 +173,9 @@ int RemoveDeviceEndpoint(Device * dev) EndpointId ep = emberAfClearDynamicEndpoint(index); gDevices[index] = NULL; ChipLogProgress(DeviceLayer, "Removed device %s from dynamic endpoint %d (index=%d)", dev->GetName(), ep, index); + // Silence complaints about unused ep when progress logging + // disabled. + UNUSED_VAR(ep); return index; } index++; diff --git a/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp b/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp index 65c6094a928613..7f1fa2476e364e 100644 --- a/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp +++ b/examples/lighting-app/lighting-common/gen/IMClusterCommandHandler.cpp @@ -1508,6 +1508,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1628,6 +1632,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1824,6 +1832,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2354,6 +2366,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3043,6 +3059,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3110,6 +3130,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3617,6 +3641,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp b/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp index e8c9315d5208b4..19b8a097585ded 100644 --- a/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp +++ b/examples/lock-app/lock-common/gen/IMClusterCommandHandler.cpp @@ -153,6 +153,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -349,6 +353,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1038,6 +1046,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1105,6 +1117,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1612,6 +1628,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp index 3b35be20e9df17..aae9a2dd29cdc8 100644 --- a/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-app/pump-common/gen/CHIPClientCallbacks.cpp @@ -514,14 +514,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -560,6 +558,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -604,10 +607,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -644,12 +657,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -696,10 +719,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp index febb1b9a966462..6bd6b21e80acca 100644 --- a/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp +++ b/examples/pump-app/pump-common/gen/IMClusterCommandHandler.cpp @@ -82,6 +82,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -202,6 +206,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -398,6 +406,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -928,6 +940,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1558,6 +1574,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1625,6 +1645,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2132,6 +2156,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp index 3b35be20e9df17..aae9a2dd29cdc8 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/CHIPClientCallbacks.cpp @@ -514,14 +514,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -560,6 +558,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -604,10 +607,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -644,12 +657,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -696,10 +719,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp index 1c8c7bbd5e9454..bf82f77b296a15 100644 --- a/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp +++ b/examples/pump-controller-app/pump-controller-common/gen/IMClusterCommandHandler.cpp @@ -82,6 +82,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -202,6 +206,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -398,6 +406,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1087,6 +1099,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1594,6 +1610,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp b/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp index fb15bcd6e7ef2e..d52e41fba9e81b 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp +++ b/examples/temperature-measurement-app/esp32/main/gen/IMClusterCommandHandler.cpp @@ -153,6 +153,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -349,6 +353,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -896,6 +904,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1403,6 +1415,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index efea4bf345d44a..8f536b1a5f35b0 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -209,6 +209,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -317,6 +321,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -436,6 +444,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -608,6 +620,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -657,6 +673,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -848,6 +868,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1028,6 +1052,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1148,6 +1176,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1344,6 +1376,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1452,6 +1488,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1982,6 +2022,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2037,6 +2081,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2221,6 +2269,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2495,6 +2547,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3184,6 +3240,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3466,6 +3526,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3533,6 +3597,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4040,6 +4108,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4271,6 +4343,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4384,6 +4460,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/examples/window-app/common/gen/IMClusterCommandHandler.cpp b/examples/window-app/common/gen/IMClusterCommandHandler.cpp index 1b78fe594c92d5..05906ec757605b 100644 --- a/examples/window-app/common/gen/IMClusterCommandHandler.cpp +++ b/examples/window-app/common/gen/IMClusterCommandHandler.cpp @@ -229,6 +229,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -918,6 +922,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1425,6 +1433,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1738,6 +1750,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 2d79881351c2ed..02d1f8103d2a65 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -496,14 +496,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -541,6 +539,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); cb->mCall(cb->mContext, status); @@ -583,10 +586,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); cb->mCall(cb->mContext, status); @@ -622,12 +635,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -672,10 +695,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt index d5b734378581bb..72e95e2a146afe 100644 --- a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt +++ b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt @@ -77,6 +77,10 @@ void Dispatch{{asCamelCased side false}}Command(app::Command * apCommandObj, Com apCommandObj->AddStatusCode(returnStatusParam, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, Protocols::SecureChannel::Id, Protocols::InteractionModel::ProtocolCode::InvalidCommand); ChipLogProgress(Zcl, "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/src/controller/data_model/gen/CHIPClientCallbacks.cpp b/src/controller/data_model/gen/CHIPClientCallbacks.cpp index f45bfa7764f20a..95eb2c0adb127e 100644 --- a/src/controller/data_model/gen/CHIPClientCallbacks.cpp +++ b/src/controller/data_model/gen/CHIPClientCallbacks.cpp @@ -514,14 +514,12 @@ bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient return true; } - chip::AttributeId attributeId = aPath.mFieldId; // attribId - ChipLogProgress(Zcl, " attributeId: 0x%04x", attributeId); + ChipLogProgress(Zcl, " attributeId: 0x%04x", aPath.mFieldId); LogIMStatus(status); if (status == Protocols::InteractionModel::ProtocolCode::Success && apData != nullptr) { - chip::TLV::TLVType attributeType = apData->GetType(); - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", attributeType); + ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); tlvFilter(apData, onSuccessCallback, onFailureCallback); } else @@ -560,6 +558,11 @@ bool emberAfWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * messa CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -604,10 +607,20 @@ bool emberAfConfigureReportingResponseCallback(ClusterId clusterId, uint8_t * me CHECK_MESSAGE_LENGTH(1); uint8_t direction = chip::Encoding::Read8(message); // reportingRole ChipLogProgress(Zcl, " direction: 0x%02x", direction); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(direction); CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // direction. + UNUSED_VAR(attributeId); Callback::Callback * cb = Callback::Callback::FromCancelable(onFailureCallback); @@ -644,12 +657,22 @@ bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); if (direction == EMBER_ZCL_REPORTING_DIRECTION_REPORTED) { CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeType. + UNUSED_VAR(attributeType); CHECK_MESSAGE_LENGTH(2); uint16_t minimumReportingInterval = chip::Encoding::LittleEndian::Read16(message); // uint16 @@ -696,10 +719,19 @@ bool emberAfDiscoverAttributesResponseCallback(ClusterId clusterId, bool discove CHECK_MESSAGE_LENGTH(4); AttributeId attributeId = chip::Encoding::LittleEndian::Read32(message); // attribId ChipLogProgress(Zcl, " attributeId: 0x%08x", attributeId); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read32 unconditionally here, because we + // want to advance the 'message' pointer even if we don't use + // attributeId. + UNUSED_VAR(attributeId); CHECK_MESSAGE_LENGTH(1); uint8_t attributeType = chip::Encoding::Read8(message); // zclType ChipLogProgress(Zcl, " attributeType: 0x%02x", attributeType); + // Silence unused var warning if progress logging is disabled. Note + // that we _do_ want to call Read8 unconditionally here, because we want + // to advance the 'message' pointer even if we don't use attributeType. + UNUSED_VAR(attributeType); } Callback::Callback * cb = Callback::Callback::FromCancelable(onSuccessCallback); diff --git a/src/controller/data_model/gen/IMClusterCommandHandler.cpp b/src/controller/data_model/gen/IMClusterCommandHandler.cpp index 8503d1ae5e6f40..7970ebafef17db 100644 --- a/src/controller/data_model/gen/IMClusterCommandHandler.cpp +++ b/src/controller/data_model/gen/IMClusterCommandHandler.cpp @@ -142,6 +142,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -256,6 +260,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -435,6 +443,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -1962,6 +1974,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2206,6 +2222,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2518,6 +2538,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2626,6 +2650,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -2734,6 +2762,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -3432,6 +3464,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4011,6 +4047,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4217,6 +4257,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4492,6 +4536,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -4964,6 +5012,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5077,6 +5129,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5191,6 +5247,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } @@ -5299,6 +5359,10 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, validArgumentCount, expectArgumentCount, TLVError, TLVUnpackError, currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); } } diff --git a/src/lib/support/PrivateHeap.cpp b/src/lib/support/PrivateHeap.cpp index b4c45352781d6b..b900470fb7591c 100644 --- a/src/lib/support/PrivateHeap.cpp +++ b/src/lib/support/PrivateHeap.cpp @@ -313,9 +313,8 @@ extern "C" void PrivateHeapDump(void * top) ChipLogProgress(Support, "========= HEAP ==========="); while (header->nextBytes != kInvalidHeapBlockSize) { - intptr_t offset = reinterpret_cast(header) - reinterpret_cast(top); - ChipLogProgress(Support, " %ld: size: %d, state: %d", static_cast(offset), static_cast(header->nextBytes), - static_cast(header->state)); + ChipLogProgress(Support, " %td: size: %d, state: %d", reinterpret_cast(header) - reinterpret_cast(top), + static_cast(header->nextBytes), static_cast(header->state)); header = NextHeader(header); }