1. typedef int (init_fnc_t) (void); it indicates that init_fnc_t is defined as the function type. This function returns int type and has no parameter.
"init_fnc_t * init_sequence [] = {cpu_init, board_init}" indicates that a one-dimensional pointer array is defined using init_fnc_t (function type). All elements in the array are pointer variables, they all point to function pointers. The return values of these functions are int type and have no parameters. More clearly, each element in the array is used to store the first address of the function entry.
2. INT (* init_fnc_t) (void); defines a function pointer (Return Value: int type, no parameter function pointer, stores the first address of the function ), typedef int (* init_fnc_t) (void); indicates defining a function pointer type. You can use the init_fnc_t symbol to define the function pointer. "init_fnc_t init_sequence [] = {cpu_init, board_init} "indicates that an array is defined using init_fnc_t (function pointer type). All elements in the array are a function pointer, cpu_init,
Board_init is a function pointer and stores the first address of the function.
In summary, I personally think the two definitions mean the same thing, but they are written differently. The array element in 1 is the pointer variable pointing to the function, the elements in array 2 are function pointers. The result is the same.
To be honest, the usage of typedef is really abnormal, and a careful one will let you fall into the trap !!! However, I think my personal C language skills will be greatly improved if I can make good use of typedef and deeply understand his connotation!
------------------------------------ Reprint------------------------------------