All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Eliminate warnings from rpcgen generated code
@ 2018-02-09 15:50 Steve Dickson
  2018-02-09 15:50 ` [PATCH 1/1] Remove warnings from rpcgen generated files Steve Dickson
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Dickson @ 2018-02-09 15:50 UTC (permalink / raw)
  To: Linux NFS Mailing list

For years, the rpcgen generated code causes 
a number of -Wunused-variable. Taking a closer
look at rpcgen , it turns out these warnings 
were caused by rpcgen trying inline the code.

Inlining is a technique that allows xdr routines
to run faster and more efficiently. It turns out
only one routine, xdr_ppathcnf(), was taking 
advantage of this technique. 

So by turning off rpcgen inline the warnings 
are eliminated with no lost of speed or efficiency

The patch also eliminates a -Wmissing-prototypes
by a hack to the nsm/Makefile.am.

Steve Dickson (1):
  Remove warnings from rpcgen genrated files

 support/export/Makefile.am | 2 +-
 support/nsm/Makefile.am    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.14.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] Remove warnings from rpcgen generated files
  2018-02-09 15:50 [PATCH 0/1] Eliminate warnings from rpcgen generated code Steve Dickson
@ 2018-02-09 15:50 ` Steve Dickson
  2018-02-13 14:23   ` Steve Dickson
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Dickson @ 2018-02-09 15:50 UTC (permalink / raw)
  To: Linux NFS Mailing list

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Remove warnings from rpcgen generated files
  2018-02-09 15:50 ` [PATCH 1/1] Remove warnings from rpcgen generated files Steve Dickson
@ 2018-02-13 14:23   ` Steve Dickson
  0 siblings, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2018-02-13 14:23 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 02/09/2018 10:50 AM, Steve Dickson wrote:
> 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>
Committed... 

steved.

> ---
>  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
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-13 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09 15:50 [PATCH 0/1] Eliminate warnings from rpcgen generated code Steve Dickson
2018-02-09 15:50 ` [PATCH 1/1] Remove warnings from rpcgen generated files Steve Dickson
2018-02-13 14:23   ` Steve Dickson

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.