I was trying to mock a header that contained the following function declaration.
int attr_assign_broadcast_cb( enum attr_group group, void (*cb_func) );
The brackets around (cb_func) seem to cause issues when creating the cmock functions. You can see this in the following error where an extra bracket is added to the _Depth parameter.
error: conflicting types for 'cb_func'
684 | void __wrap_attr_assign_broadcast_cb_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, enum attr_group group, void( cb_func), int cb_func)_Depth, int cmock_to_return);
I did find a work around for the issue by using a typedef for the function pointer as that eliminated the extra brackets from the function declaration.
I was trying to mock a header that contained the following function declaration.
int attr_assign_broadcast_cb( enum attr_group group, void (*cb_func) );
The brackets around (cb_func) seem to cause issues when creating the cmock functions. You can see this in the following error where an extra bracket is added to the _Depth parameter. error: conflicting types for 'cb_func' 684 | void __wrap_attr_assign_broadcast_cb_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, enum attr_group group, void( cb_func), int cb_func)_Depth, int cmock_to_return);
I did find a work around for the issue by using a typedef for the function pointer as that eliminated the extra brackets from the function declaration.
Ian