svn commit: r311947 - head/usr.bin/rpcgen
Pedro F. Giffuni
pfg at FreeBSD.org
Wed Jan 11 23:05:30 UTC 2017
Author: pfg
Date: Wed Jan 11 23:05:29 2017
New Revision: 311947
URL: https://svnweb.freebsd.org/changeset/base/311947
Log:
rpcgen(1): Avoid unused variable warning on generated code.
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.
Obtained from: OpenBSD (CVS rev 1.28)
MFC after: 1 week
Modified:
head/usr.bin/rpcgen/rpc_cout.c
Modified: head/usr.bin/rpcgen/rpc_cout.c
==============================================================================
--- head/usr.bin/rpcgen/rpc_cout.c Wed Jan 11 22:54:04 2017 (r311946)
+++ head/usr.bin/rpcgen/rpc_cout.c Wed Jan 11 23:05:29 2017 (r311947)
@@ -551,7 +551,8 @@ emit_struct(definition *def)
}
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){
f_print(fout, "\tint i;\n");
break;
}
More information about the svn-src-head
mailing list