[Openswan dev] 1.09: gcc 3.4 compilation fixes

Vinay K Nallamothu vinay.nallamothu at gsecone.com
Thu Feb 10 11:50:46 CET 2005


GCC 3.4X and higher throw the following error on empty "default" labels
at the end of switch statements:
	"error: label at end of compound statement"

The patch below patch fixes these errors.

 ipsec_rcv.c       |    1 +
 ipsec_tunnel.c    |    2 ++
 pfkey_v2_parser.c |    2 ++
 3 files changed, 5 insertions(+)
=========================================================
diff -urN openswan-1.0.9/klips/net/ipsec/ipsec_rcv.c openswan-1.0.9-m/klips/net/ipsec/ipsec_rcv.c
--- openswan-1.0.9/klips/net/ipsec/ipsec_rcv.c	2003-12-04 08:34:38.000000000 +0530
+++ openswan-1.0.9-m/klips/net/ipsec/ipsec_rcv.c	2005-02-10 11:40:42.477846104 +0530
@@ -1321,6 +1321,7 @@
 				break;
 #endif /* CONFIG_IPSEC_ENC_3DES */
 			default:
+				;
 			}
 			next_header = idat[ilen - 1];
 			padlen = idat[ilen - 2];
diff -urN openswan-1.0.9/klips/net/ipsec/ipsec_tunnel.c openswan-1.0.9-m/klips/net/ipsec/ipsec_tunnel.c
--- openswan-1.0.9/klips/net/ipsec/ipsec_tunnel.c	2003-12-04 08:33:24.000000000 +0530
+++ openswan-1.0.9-m/klips/net/ipsec/ipsec_tunnel.c	2005-02-10 11:40:12.397419024 +0530
@@ -1036,6 +1036,7 @@
 				stats->tx_dropped++;
 			}
 			default:
+				;
 				/* XXX what do we do with an unknown shunt spi? */
 			} /* switch (ntohl(outgoing_said.spi)) */
 			goto cleanup;
@@ -1936,6 +1937,7 @@
 					iph->tos = 0;
 					break;
 				default:
+					;
 				}
 #ifdef NET_21
 #ifdef NETDEV_23
diff -urN openswan-1.0.9/klips/net/ipsec/pfkey_v2_parser.c openswan-1.0.9-m/klips/net/ipsec/pfkey_v2_parser.c
--- openswan-1.0.9/klips/net/ipsec/pfkey_v2_parser.c	2003-11-19 07:59:41.000000000 +0530
+++ openswan-1.0.9-m/klips/net/ipsec/pfkey_v2_parser.c	2005-02-10 11:38:03.258051192 +0530
@@ -501,6 +501,7 @@
 				    s->sa_family);
 		}
 	default:
+		;
 	}
 	
 	/* XXX check if port!=0 */
@@ -4030,6 +4031,7 @@
 		}
 		break;
 	default:
+		;
 	}
 	
 	/* The NULL below causes the default extension parsers to be used */




More information about the Dev mailing list