[PATCH] fix CM compilation for gcc 2.95 (was Re: [openib-general] RFC on SDP checkin)

Roland Dreier roland at topspin.com
Fri Feb 11 14:17:16 PST 2005


gcc 2.95 fails on the current tree with

    cm.c:140: field `path' has incomplete type

Unfortunately, although the C spec says that using just "[]" to
declare arrays at the end of a struct is correct, gcc 2.95 insists on
"[0]".  This patch makes that change.

Signed-off-by: Roland Dreier <roland at topspin.com>

Index: infiniband/core/cm.c
===================================================================
--- infiniband/core/cm.c	(revision 1772)
+++ infiniband/core/cm.c	(working copy)
@@ -137,7 +137,7 @@ struct cm_work {
 	struct ib_mad_recv_wc *mad_recv_wc;	/* Received MADs */
 	u32 local_id;				/* Established */
 	struct ib_cm_event cm_event;
-	struct ib_sa_path_rec path[];
+	struct ib_sa_path_rec path[0];
 };
 
 static inline void cm_deref_id(struct cm_id_private *cm_id_priv)



More information about the general mailing list