Fix rpcbind/rpcinfo build warnings
Subsystems (2)
cover Fix rpcbind/rpcinfo build warnings
Hi Steve-
Here's a handful of minor fix-ups for rpcbind that eliminate a bunch of warnings from autotool, make, and gcc.
---
Chuck Lever (5):
rpcbind: Squelch autotool warning
rpcbind: Squelch make warnings
rpcbind: Squelch a compiler warning
rpcbind: Squelch a compiler warning
rpcbind: Squelch a compiler warning
configure.in | 6 +++--- src/Makefile.am | 5 ----- src/rpcbind.c | 1 + src/rpcinfo.c | 2 +- src/warmstart.c | 1 - 5 files changed, 5 insertions(+), 10 deletions(-)
Signature · 1 line
Chuck Lever <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 20081021220247.19488.82225.stgit-meopP2rzCrTwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org
PATCH 1/5 rpcbind: Squelch a compiler warning
Remove unused variable in read_struct(). This eliminates the compiler warning:
warmstart.c: In function =E2=80=98read_struct=E2=80=99:
warmstart.c:106: warning: unused variable =E2=80=98sbuf=E2=80=99
---
src/warmstart.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
src/warmstart.c +0 -0
@@ -103,7 +103,6 @@ read_struct(char *filename, xdrproc_t structproc, v=
oid *list)
{
FILE *fp;
XDR xdrs;
- struct stat sbuf;
=20
if (debugging)
fprintf(stderr, "rpcbind: using '%s' startup file\n", filename);
PATCH 2/5 rpcbind: Squelch a compiler warning
In reply to a message not in the archiveInclude <nss.h> to get a forward declaration of __nss_configure_lookup(= ).
This eliminates the compiler warning:
rpcbind.c: In function =E2=80=98main=E2=80=99:
rpcbind.c:163: warning: implicit declaration of function
=E2=80=98__nss_configure_lookup=E2=80=99
---
configure.in | 2 +- src/rpcbind.c | 1 + 2 files changed, 2 insertions(+), 1 deletions(-)
configure.in +1 -1
@@ -48,7 +48,7 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h \ netinet/in.h stdlib.h string.h \ sys/param.h sys/socket.h \ sys/time.h syslog.h \ - unistd.h]) =20 + unistd.h nss.h])
=20
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([tirpc], [clnt_create])
src/rpcbind.c +1 -0
@@ -68,6 +68,7 @@#include <pwd.h> #include <string.h> #include <errno.h> +#include <nss.h> #include "config.h" #include "rpcbind.h"
=20
PATCH 3/5 rpcbind: Squelch a compiler warning
In reply to a message not in the archiveRemove a needless pointer-to-integer conversion. getnameinfo(3) wants a size value greater than or equal to offsetof(struct sockaddr_un, sun_path). Since pointers can be different sizes depending on the hardware platform, let's make this a simple constant instead.
This eliminates the compiler warning:
rpcinfo.c: In function =E2=80=98sa_len=E2=80=99:
rpcinfo.c:666: warning: cast from pointer to integer of different size
when building on x86-64.
---
src/rpcinfo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
src/rpcinfo.c +0 -1
@@ -663,7 +663,7 @@ sa_len(struct sockaddr *sa)switch (sa->sa_family) {case AF_LOCAL : - salen =3D (socklen_t) (((struct sockaddr_un *) NULL)->sun_=
path);
+ salen =3D sizeof (struct sockaddr_un);
break;
case AF_INET:
salen =3D sizeof (struct sockaddr_in);PATCH 4/5 rpcbind: Squelch make warnings
In reply to a message not in the archiveEliminate make warnings when building rpcbind and rpcinfo:
make[3]: Circular security.o <- security.o dependency dropped. make[3]: Circular util.o <- security.o dependency dropped. make[3]: Circular util.o <- util.o dependency dropped. make[3]: Circular util.o <- check_bound.o dependency dropped. make[3]: Circular pmap_svc.o <- security.o dependency dropped. make[3]: Circular pmap_svc.o <- util.o dependency dropped. make[3]: Circular pmap_svc.o <- check_bound.o dependency dropped. make[3]: Circular pmap_svc.o <- pmap_svc.o dependency dropped.
and so on.
Apparently src/Makefile.am needs either a list of source files or a list of object files, but not both.
---
src/Makefile.am | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
src/Makefile.am +0 -5
@@ -31,9 +31,4 @@ rpcbind_LDFLAGS = -lpthread -ltirpc rpcbind_LDADD = $(LIB_TIRPC) AM_CPPFLAGS = -I/usr/include/tirpc -DCHECK_LOCAL -DPORTMAP \ -DFACILITY=LOG_MAIL -DSEVERITY=LOG_INFO - -$(rpcbind_OBJECTS) : security.o util.o check_bound.o pmap_svc.o \ - rpcb_svc.o rpcb_svc_com.o rpcb_svc_4.o \ - rpcb_stat.o rpcbind.o warmstart.o -$(rpcinfo_OBJECTS) : rpcinfo.o
PATCH 5/5 rpcbind: Squelch autotool warning
In reply to a message not in the archiveChange order of AC_PROG_LIBTOOL macro invocation in configure.in to eliminate autotool warning:
Remember to add AC_PROG_LIBTOOL' to configure.in'.
---
configure.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
configure.in +2 -2
@@ -5,14 +5,14 @@ AC_CONFIG_SRCDIR([src/rpcbind.c]) AC_PROG_CC AM_CONFIG_HEADER(config.h) - AC_PROG_LIBTOOL - ##AC_PROG_RANLIB AC_HEADER_DIRENT AC_PREFIX_DEFAULT(/usr) AC_CONFIG_SRCDIR([src/config.h.in]) AC_CONFIG_HEADERS([src/config.h]) +AC_PROG_LIBTOOL + AC_ARG_ENABLE(debug,[ --enable-debug Turns on rpcbind debugging], [case "${enableval}" in yes) debug=true ;;
Quoted 15 lines · Chuck Lever
Hi Steve-
Here's a handful of minor fix-ups for rpcbind that eliminate a bunch of warnings from autotool, make, and gcc.
---
Chuck Lever (5):
rpcbind: Squelch autotool warning
rpcbind: Squelch make warnings
rpcbind: Squelch a compiler warning
rpcbind: Squelch a compiler warning
rpcbind: Squelch a compiler warning
Quoted 7 lines
configure.in | 6 +++--- src/Makefile.am | 5 ----- src/rpcbind.c | 1 + src/rpcinfo.c | 2 +- src/warmstart.c | 1 - 5 files changed, 5 insertions(+), 10 deletions(-)
All committed... thanks!
steved.