ibv_modify_qp function has 2 different signatures for different version of the library. Both the libraries install the header files in same location. Below are the 2 versions.
int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
int attr_mask);
int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
enum ibv_qp_attr_mask attr_mask);
In my library, I am passing the pointer of my driver specific function to the ibv_context_ops structure.
/*ibv_context_ops field contains function pointers to driver specific functions*/
static struct ibv_context_ops c4iw_ctx_ops = {
.modify_qp = c4iw_modify_qp,
}
int c4iw_modify_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr,
int attr_mask);
So when the prototype matches I don't see any warning, but when the prototypes differ, warning will be generated. Right now I am using CFLAGS to conditionally compile as shown below.
#ifdef IBV_VER2
int c4iw_modify_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr,
int attr_mask);
#else
int c4iw_modify_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr,
enum ibv_qp_attr_mask attr_mask);
#endif
Is there anyway I can make use of gnu automake to check for function prototype and substitute function arguments based on the function prototype defined in the library header file.