diff options
author | pfg <pfg@FreeBSD.org> | 2017-01-18 15:22:54 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-01-18 15:22:54 +0000 |
commit | 4d4bfe27534638421ca344bba7e3ed69a6008615 (patch) | |
tree | 4b1223c701ca776741d44790e7198f21586ec90b /usr.bin/rpcgen/rpc_cout.c | |
parent | fefedac602874fa19643279757c8069e48c5e97b (diff) | |
download | FreeBSD-src-4d4bfe27534638421ca344bba7e3ed69a6008615.zip FreeBSD-src-4d4bfe27534638421ca344bba7e3ed69a6008615.tar.gz |
MFC r311947, r311981:
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)
rpcgen(1): Check getrlimit() return for generated code.
Obtained from: NetBSD (CVS rev 1.27, 1.28)
Diffstat (limited to 'usr.bin/rpcgen/rpc_cout.c')
-rw-r--r-- | usr.bin/rpcgen/rpc_cout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/rpcgen/rpc_cout.c b/usr.bin/rpcgen/rpc_cout.c index 0c2ce20..6e245bf 100644 --- a/usr.bin/rpcgen/rpc_cout.c +++ b/usr.bin/rpcgen/rpc_cout.c @@ -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; } |