diff mbox series

[nfs-utils,6/7] rpcgen: rpc_hout: fix potential -Wformat-security warning

Message ID 20200103215039.27471-7-giulio.benetti@benettiengineering.com (mailing list archive)
State Accepted
Headers show
Series silence some warning in rpcgen | expand

Commit Message

Giulio Benetti Jan. 3, 2020, 9:50 p.m. UTC
f_print()'s argument "separator" is not known because it's passed as an
argument and with -Wformat-security will cause a useless warning. Let's
ignore by adding "#pragma GCC diagnostic ignored/warning" before and
after f_print().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 tools/rpcgen/rpc_hout.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/tools/rpcgen/rpc_hout.c b/tools/rpcgen/rpc_hout.c
index ea1cb24f..999c061f 100644
--- a/tools/rpcgen/rpc_hout.c
+++ b/tools/rpcgen/rpc_hout.c
@@ -467,7 +467,9 @@  pdeclaration(char *name, declaration *dec, int tab, char *separator)
 			break;
 		}
 	}
+#pragma GCC diagnostic ignored "-Wformat-security"
 	f_print(fout, separator );
+#pragma GCC diagnostic warning "-Wformat-security"
 }
 
 static int