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
This commit is contained in:
Pedro F. Giffuni 2017-01-11 23:05:29 +00:00
parent c83bcfbd2e
commit e9ed334fd2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311947

View file

@ -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;
}