I have the following struct:
typedef void (*HSM_State_Fcn)(void*, size_t);
typedef HSM_State_Fcn HSM_Dest_State_Fcn;
typedef uint8_t (*HSM_Guard_Fcn)(void*, size_t);
typedef void (*HSM_Action_Fcn)(void*, size_t);
typedef struct HSM_Transition_Tag
{
HSM_Dest_State_Fcn dest_fcn;
HSM_Guard_Fcn guard_fcn;
HSM_Action_Fcn action_fcn;
}HSM_Transition_T;
And I have the following 2D array that I want every element to be NULL:
static HSM_Transition_T Transition_Table_Array_Test[3][3] = {NULL};
As you can see I tried to equal to {NULL} but I get the following warning:
warning: (near initialization for 'Transition_Table_Array_Test[0]') [-Wmissing-braces]
What would be the correct approach to initialize every element to NULL?
If I make it:
static HSM_Transition_T Transition_Table_Array_Test[3][3] = {{NULL}};
I get the same error.
Stuff *stuff[3][3] = {{NULL}};static. You don't need to set it explicitly.