summaryrefslogtreecommitdiffstats
path: root/usr.bin/rpcgen
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2016-12-22 16:42:55 +0000
committerkrw <krw@openbsd.org>2016-12-22 16:42:55 +0000
commit276c2c167ac75a1ac10a313cbba6b4d2d02f4bfe (patch)
treee8051964de9efdaae6f6acd92fc8d2846d9860df /usr.bin/rpcgen
parentSimply some for() loops to eliminate "computed, not used" warnings. (diff)
downloadwireguard-openbsd-276c2c167ac75a1ac10a313cbba6b4d2d02f4bfe.tar.xz
wireguard-openbsd-276c2c167ac75a1ac10a313cbba6b4d2d02f4bfe.zip
Avoid "unused variable 'i'" warnings in generated .c files by only emitting
the "int i;" for non-opaque arrays. Opaque arrays use xdr_opaque() rather than iterating over the array. Eliminates another couple of dozen warnings from snap build output. ok deraadt@ millert@
Diffstat (limited to 'usr.bin/rpcgen')
-rw-r--r--usr.bin/rpcgen/rpc_cout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/rpcgen/rpc_cout.c b/usr.bin/rpcgen/rpc_cout.c
index 62b785f8832..576fe67e2f6 100644
--- a/usr.bin/rpcgen/rpc_cout.c
+++ b/usr.bin/rpcgen/rpc_cout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc_cout.c,v 1.27 2016/12/20 22:19:08 krw Exp $ */
+/* $OpenBSD: rpc_cout.c,v 1.28 2016/12/22 16:42:55 krw Exp $ */
/* $NetBSD: rpc_cout.c,v 1.6 1996/10/01 04:13:53 cgd Exp $ */
/*
@@ -425,7 +425,8 @@ emit_struct(def)
return;
}
for (dl = def->def.st.decls; dl != NULL; dl = dl->next)
- if (dl->decl.rel == REL_VECTOR) {
+ if (dl->decl.rel == REL_VECTOR &&
+ strcmp(dl->decl.type, "opaque") != 0) {
fprintf(fout, "\tint i;\n");
break;
}