All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/1] Remove warnings from rpcgen generated files
Date: Fri,  9 Feb 2018 10:50:42 -0500	[thread overview]
Message-ID: <20180209155042.28461-2-steved@redhat.com> (raw)
In-Reply-To: <20180209155042.28461-1-steved@redhat.com>

The xdr c-files, generated from .x by rpcgen, in both
libnsm.a and libexport.a libraries cause the
following warnings:

mount_xdr.c:43:20: warning: unused variable 'buf' [-Wunused-variable]
sm_inter_xdr.c:37:20: warning: unused variable 'buf' [-Wunused-variable]
sm_inter_xdr.c:51:6: warning: unused variable 'i' [-Wunused-variable]

These warnings are caused by rpcgen trying in inline
the xdr routines. It turns out no inlining was happening,
except for one routine. So turning off inlining eliminated
these warnings.

This patch also eliminates a Werror missing-prototypes in sm_inter.h

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/export/Makefile.am | 2 +-
 support/nsm/Makefile.am    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/support/export/Makefile.am b/support/export/Makefile.am
index be3de69..13f7a49 100644
--- a/support/export/Makefile.am
+++ b/support/export/Makefile.am
@@ -35,7 +35,7 @@ $(GENFILES_CLNT): %_clnt.c: %.x $(RPCGEN)
 
 $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
 	test -f $@ && rm -rf $@ || true
-	$(RPCGEN) -c -o $@ $<
+	$(RPCGEN) -c -i 0 -o $@ $<
 
 $(GENFILES_H): %.h: %.x $(RPCGEN)
 	test -f $@ && rm -rf $@ || true
diff --git a/support/nsm/Makefile.am b/support/nsm/Makefile.am
index 2038e68..8f5874e 100644
--- a/support/nsm/Makefile.am
+++ b/support/nsm/Makefile.am
@@ -32,11 +32,12 @@ $(GENFILES_SVC): %_svc.c: %.x $(RPCGEN)
 
 $(GENFILES_XDR): %_xdr.c: %.x $(RPCGEN)
 	test -f $@ && rm -rf $@ || true
-	$(RPCGEN) -c -o $@ $<
+	$(RPCGEN) -c -i 0 -o $@ $<
 
 $(GENFILES_H): %.h: %.x $(RPCGEN)
 	test -f $@ && rm -rf $@ || true
 	$(RPCGEN) -h -o $@ $<
+	echo "void sm_prog_1(struct svc_req *, SVCXPRT *);" >> $@
 	rm -f $(top_builddir)/support/include/sm_inter.h
 	$(LN_S) ../nsm/sm_inter.h $(top_builddir)/support/include/sm_inter.h
 
-- 
2.14.3


  reply	other threads:[~2018-02-09 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 15:50 [PATCH 0/1] Eliminate warnings from rpcgen generated code Steve Dickson
2018-02-09 15:50 ` Steve Dickson [this message]
2018-02-13 14:23   ` [PATCH 1/1] Remove warnings from rpcgen generated files Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180209155042.28461-2-steved@redhat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.