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 Feb 7, 2022
1 parent d5d9dc7 commit 56be65c
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 56be65c

Please sign in to comment.