diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 7e2b07f0b81e14..1b8180dc9f64c5 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -371,11 +371,14 @@ EmberAfStatus emAfClusterPreAttributeChangedCallback(const app::ConcreteAttribut } else { - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - EmberAfGenericClusterFunction f = emberAfFindClusterFunction(cluster, CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION); + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + // Casting and calling a function pointer on the same line results in ignoring the return + // of the call on gcc-arm-none-eabi-9-2019-q4-major + EmberAfClusterPreAttributeChangedCallback f = (EmberAfClusterPreAttributeChangedCallback)( + emberAfFindClusterFunction(cluster, CLUSTER_MASK_PRE_ATTRIBUTE_CHANGED_FUNCTION)); if (f != NULL) { - status = ((EmberAfClusterPreAttributeChangedCallback) f)(attributePath, attributeType, size, value); + status = f(attributePath, attributeType, size, value); } return status; }