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:
parent
c83bcfbd2e
commit
e9ed334fd2
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user