Skip to content

Commit

Permalink
Put temporary fix for function pointer casting error in arm gcc (#14830)
Browse files Browse the repository at this point in the history
* Put temporary fix for function pointer casting error in arm gcc

* Restyle and add comment to prevent future unintended change
  • Loading branch information
fessehaeve authored and pull[bot] committed Feb 22, 2024
1 parent e71828a commit 377c550
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 377c550

Please sign in to comment.