Here is a part of the code that is creating some problems.
Code:
1 typedef int (mpich_peruse_callback_f)(peruse_event_h event_h,
2 MPI_Aint unique_id, void * spec, void * param);
3
4
5 struct mpich_peruse_handle_t
6 {
7 int handle;
8 int ref_count;
9 int active; /**< Whether this handle has been activated */
10 int event; /**< Event being watched */
11 int type; /**< Object-type this event is registered on */
12 MPID_Comm *comm; /**< Corresponding communicicator */
13 mpich_peruse_callback_f *fn; /**< Callback function specified by user */
14 void *param; /**< Parameters being passed to callback */
15 };
16
17 typedef struct mpich_peruse_handle_t mpich_peruse_handle_t;
18
19
20 void PERUSE_TRACE_COMM_EVENT(int event, MPID_Request *req, int op)
21 {
22 if( NULL != req->comm->c_peruse_handles )
23 {
24 mpich_peruse_handle_t * _ptr = req->comm->c_peruse_handles[(event)];
25 printf(" ref_count = %d\n", _ptr->ref_count);
26 if (NULL != _ptr && _ptr->active) {
27 peruse_comm_spec_t _comm_spec;
28 _comm_spec.comm = req->comm;
29 _comm_spec.operation = (op);
30 _ptr->fn(_ptr, (MPI_Aint)(req), &_comm_spec, _ptr->param);
31 }
32 }
33 return;
34 }
And these are the error messages being displayed :
Code:
Line no 13 : error: expected specifier-qualifier-list before ‘mpich_peruse_callback_f’
In function ‘PERUSE_TRACE_COMM_EVENT’:
Line no 30 : error: ‘mpich_peruse_handle_t’ has no member named ‘fn’
Line no 30 : error: ‘mpich_peruse_handle_t’ has no member named ‘param’
I am totally vexed by these errors as they seem to be pretty much correct. 'mpich_peruse_callback_f' has been defined before the structure 'struct mpich_peruse_handle_t' is defined. And the structure clearly contain the members 'fn' and 'param'.
I tried compiling using the -E option, I did see anything suspicious in these lines. Am I missing something that is obvious here?
Thanks.