Index: test/dapltest/test/dapl_limit.c
===================================================================
--- test/dapltest/test/dapl_limit.c.orig	2009-04-22 22:14:15.000000000 +0200
+++ test/dapltest/test/dapl_limit.c	2011-02-02 18:18:01.106946855 +0100
@@ -161,6 +161,7 @@ limit_test(DT_Tdep_Print_Head * phead, L
 		unsigned int count = START_COUNT;
 		OneOpen *hdlptr = (OneOpen *)
 		    DT_Mdep_Malloc(count * sizeof(*hdlptr));
+                union { OneOpen **oop; DAT_HANDLE **dhpp; }pun = { &hdlptr };
 
 		/* IA Exhaustion test loop */
 		if (hdlptr) {
@@ -174,7 +175,7 @@ limit_test(DT_Tdep_Print_Head * phead, L
 				DT_Mdep_Schedule();
 				if (w == count
 				    && !more_handles(phead,
-						     (DAT_HANDLE **) & hdlptr,
+						     pun.dhpp,
 						     &count, sizeof(*hdlptr))) {
 					DT_Tdep_PT_Printf(phead,
 							  "%s: IAs opened: %d\n",
@@ -946,6 +947,7 @@ limit_test(DT_Tdep_Print_Head * phead, L
 		unsigned int count = START_COUNT;
 		Bpool **hdlptr = (Bpool **)
 		    DT_Mdep_Malloc(count * sizeof(*hdlptr));
+                union { Bpool ***bpppp; DAT_HANDLE **dhpp; }pun = { &hdlptr };
 
 		/* LMR Exhaustion test loop */
 		if (hdlptr) {
@@ -960,7 +962,7 @@ limit_test(DT_Tdep_Print_Head * phead, L
 				DT_Mdep_Schedule();
 				if (w == count
 				    && !more_handles(phead,
-						     (DAT_HANDLE **) & hdlptr,
+						     pun.dhpp,
 						     &count, sizeof(*hdlptr))) {
 					DT_Tdep_PT_Printf(phead,
 							  "%s: no memory for LMR handles\n",
@@ -1034,6 +1036,8 @@ limit_test(DT_Tdep_Print_Head * phead, L
 		unsigned int count = START_COUNT;
 		DAT_LMR_TRIPLET *hdlptr = (DAT_LMR_TRIPLET *)
 		    DT_Mdep_Malloc(count * cmd->width * sizeof(*hdlptr));
+                union { DAT_LMR_TRIPLET **dltp; DAT_HANDLE **dhpp; }pun =
+                    { &hdlptr };
 
 		/* Recv-Post Exhaustion test loop */
 		if (hdlptr) {
@@ -1048,8 +1052,7 @@ limit_test(DT_Tdep_Print_Head * phead, L
 			for (w = 0; w < cmd->maximum && !done; w++) {
 				DT_Mdep_Schedule();
 				if (w == count
-				    && !more_handles(phead,
-						     (DAT_HANDLE **) & hdlptr,
+				    && !more_handles(phead, pun.dhpp,
 						     &count,
 						     cmd->width *
 						     sizeof(*hdlptr))) {
Index: dapl/openib_scm/cm.c
===================================================================
--- dapl/openib_scm/cm.c.orig	2010-08-09 21:53:52.000000000 +0200
+++ dapl/openib_scm/cm.c	2011-02-02 18:37:58.979008485 +0100
@@ -706,14 +706,15 @@ static void dapli_socket_connect_rtu(dp_
 	len = recv(cm_ptr->socket, (char *)&cm_ptr->msg, exp, 0);
 	if (len != exp || ntohs(cm_ptr->msg.ver) != DCM_VER) {
 		int err = dapl_socket_errno();
+		union{ uint8_t *ui8p; uint16_t *ui16p; }pun = { &cm_ptr->msg.resv[0] };
+		union{ uint8_t *ui8p; uint16_t *ui16p; }pun2 = { &cm_ptr->msg.resv[2] };
 		dapl_log(DAPL_DBG_TYPE_WARN,
 			 " CONN_RTU read: sk %d ERR 0x%x, rcnt=%d, v=%d -> %s PORT L-%x R-%x PID L-%x R-%x\n",
 			 cm_ptr->socket, err, len, ntohs(cm_ptr->msg.ver),
 			 inet_ntoa(((struct sockaddr_in *)&cm_ptr->addr)->sin_addr),
 			 ntohs(((struct sockaddr_in *)&cm_ptr->msg.daddr.so)->sin_port),
 			 ntohs(((struct sockaddr_in *)&cm_ptr->addr)->sin_port),
-			 ntohs(*(uint16_t*)&cm_ptr->msg.resv[0]),
-			 ntohs(*(uint16_t*)&cm_ptr->msg.resv[2]));
+			 ntohs(*pun.ui16p), ntohs(*pun2.ui16p));
 
 		/* Retry; corner case where server tcp stack resets under load */
 		if (err == ECONNRESET) {
Index: dapl/openib_ucm/cm.c
===================================================================
--- dapl/openib_ucm/cm.c.orig	2010-08-09 22:09:45.000000000 +0200
+++ dapl/openib_ucm/cm.c	2011-02-02 18:44:57.347480260 +0100
@@ -155,6 +155,7 @@ static void ucm_free_port(ib_hca_transpo
 static void ucm_check_timers(dp_ib_cm_handle_t cm, int *timer)
 {
 	DAPL_OS_TIMEVAL time;
+	union{ uint8_t *ui8p; DAT_UINT32 *duip; }pun = { &cm->msg.resv[0] };
 
         dapl_os_lock(&cm->lock);
 	dapl_os_get_time(&time); 
@@ -192,8 +193,8 @@ static void ucm_check_timers(dp_ib_cm_ha
 				 ntohs(cm->msg.daddr.ib.lid), 
 				 ntohs(cm->msg.dport),
 				 ntohl(cm->msg.daddr.ib.qpn),  
-				 ntohl(*(DAT_UINT32*)cm->msg.resv),
-				 ntohl(*(DAT_UINT32*)cm->msg.resv), 
+				 ntohl(*pun.duip),
+				 ntohl(*pun.duip),
 				 (time - cm->timer)/1000, 
 				 cm->hca->ib_trans.rtu_time << cm->retries);
 			cm->retries++;
@@ -217,8 +218,8 @@ static void ucm_check_timers(dp_ib_cm_ha
 				 ntohs(cm->msg.daddr.ib.lid), 
 				 ntohs(cm->msg.dport),
 				 ntohl(cm->msg.dqpn), 
-				 ntohl(*(DAT_UINT32*)cm->msg.resv),
-				 ntohl(*(DAT_UINT32*)cm->msg.resv), 
+				 ntohl(*pun.duip),
+				 ntohl(*pun.duip),
 				 (time - cm->timer)/1000, 
 				 cm->hca->ib_trans.rtu_time << cm->retries);
 			cm->retries++;
@@ -671,6 +672,7 @@ void dapls_cm_release(dp_ib_cm_handle_t
 dp_ib_cm_handle_t dapls_ib_cm_create(DAPL_EP *ep)
 {
 	dp_ib_cm_handle_t cm;
+	union{ uint8_t *ui8p; DAT_UINT32 *duip; }pun = { &cm->msg.resv[0] };
 
 	/* Allocate CM, init lock, and initialize */
 	if ((cm = dapl_os_alloc(sizeof(*cm))) == NULL)
@@ -687,7 +689,7 @@ dp_ib_cm_handle_t dapls_ib_cm_create(DAP
 	dapls_cm_acquire(cm);
 
 	cm->msg.ver = htons(DCM_VER);
-	*(DAT_UINT32*)cm->msg.resv = htonl(dapl_os_getpid()); /* exchange PID for debugging */
+	*pun.duip = htonl(dapl_os_getpid()); /* exchange PID for debugging */
 	
 	/* ACTIVE: init source address QP info from local EP */
 	if (ep) {
@@ -833,6 +835,8 @@ DAT_RETURN dapli_cm_disconnect(dp_ib_cm_
 {
 	int finalize = 1;
 	int wakeup = 0;
+	union{ uint8_t *ui8p; DAT_UINT32 *duip; }pun = { &cm->msg.resv[0] };
+
 
 	dapl_os_lock(&cm->lock);
 	switch (cm->state) {
@@ -888,8 +892,8 @@ DAT_RETURN dapli_cm_disconnect(dp_ib_cm_
 			ntohs(cm->msg.daddr.ib.lid),
 			ntohs(cm->msg.dport),
 			ntohl(cm->msg.daddr.ib.qpn),
-			ntohs(cm->msg.op) == DCM_REQ ? 0 : ntohl(*(DAT_UINT32*)cm->msg.resv), 
-			ntohs(cm->msg.op) == DCM_REQ ? 0 : ntohl(*(DAT_UINT32*)cm->msg.resv)); 
+			ntohs(cm->msg.op) == DCM_REQ ? 0 : ntohl(*pun.duip), 
+			ntohs(cm->msg.op) == DCM_REQ ? 0 : ntohl(*pun.duip)); 
 
 		dapl_os_unlock(&cm->lock);
 		return DAT_SUCCESS;
