在 2016/10/27 0:09, Jason Gunthorpe 写道: > On Wed, Oct 26, 2016 at 03:23:38PM +0800, oulijun wrote: > >> the build is fail and the print log as follows: >> >> error: size of unnamed array is negative >> attr->cap.max_recv_wr = min(context->max_qp_wr, attr->cap.max_recv_wr); > > It is telling you the types are not the same, and this is a source of bugs > as C has some counter intuitive rules regarding type promotion. > > 1) Audit max_qp_wr and max_recv_wr to see if they really should be > different types, if not fix context->max_qp_wr to match > > 2) If they are legitimately different then use > > min_t(<desired type>, context->max_qp_wr, attr->cap.max_recv_wr); > > Think carefully about what common type is used because both arguments > will be casted, and the goal is to avoid a loss of precision or > signdedness in the cast. > > Jason > > . > thanks, I see it. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html