Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jun 2009 19:22:12 +0000 (UTC)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r193738 - stable/7/usr.bin/rpcgen
Message-ID:  <200906081922.n58JMCSB039638@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Mon Jun  8 19:22:12 2009
New Revision: 193738
URL: http://svn.freebsd.org/changeset/base/193738

Log:
  merge r173761: generate code that respects C99's strict aliasing rules.

Modified:
  stable/7/usr.bin/rpcgen/   (props changed)
  stable/7/usr.bin/rpcgen/rpc_cout.c

Modified: stable/7/usr.bin/rpcgen/rpc_cout.c
==============================================================================
--- stable/7/usr.bin/rpcgen/rpc_cout.c	Mon Jun  8 18:58:54 2009	(r193737)
+++ stable/7/usr.bin/rpcgen/rpc_cout.c	Mon Jun  8 19:22:12 2009	(r193738)
@@ -200,11 +200,13 @@ print_ifsizeof(int indent, const char *p
 }
 
 static void
-print_ifclose(int indent)
+print_ifclose(int indent, int brace)
 {
 	f_print(fout, "))\n");
 	tabify(fout, indent);
 	f_print(fout, "\treturn (FALSE);\n");
+	if (brace)
+		f_print(fout, "\t}\n");
 }
 
 static void
@@ -212,12 +214,16 @@ print_ifstat(int indent, const char *pre
     const char *amax, const char *objname, const char *name)
 {
 	const char *alt = NULL;
+	int brace = 0;
 
 	switch (rel) {
 	case REL_POINTER:
+		brace = 1;
+		f_print(fout, "\t{\n");
+		f_print(fout, "\t%s **pp = %s;\n", type, objname);
 		print_ifopen(indent, "pointer");
 		print_ifarg("(char **)");
-		f_print(fout, "%s", objname);
+		f_print(fout, "pp");
 		print_ifsizeof(0, prefix, type);
 		break;
 	case REL_VECTOR:
@@ -274,7 +280,7 @@ print_ifstat(int indent, const char *pre
 		print_ifarg(objname);
 		break;
 	}
-	print_ifclose(indent);
+	print_ifclose(indent, brace);
 }
 
 /* ARGSUSED */
@@ -283,7 +289,7 @@ emit_enum(definition *def __unused)
 {
 	print_ifopen(1, "enum");
 	print_ifarg("(enum_t *)objp");
-	print_ifclose(1);
+	print_ifclose(1, 0);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906081922.n58JMCSB039638>