Skip to contentSkip to conversation

Fix rpcbind/rpcinfo build warnings

PATCH In review Chuck Lever 2 participants 7 messages Oct 21, 2008 – Oct 28, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#2 lore raw

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
index 91e482b..d52a835 100644
@@ -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);

#3 lore raw

PATCH 2/5 rpcbind: Squelch a compiler warning

In reply to a message not in the archive

Include <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
index 9ff0bc7..69f4169 100644
@@ -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
index e0e7ddf..71b372d 100644
@@ -68,6 +68,7 @@
 #include <pwd.h>
 #include <string.h>
 #include <errno.h>
+#include <nss.h>
 #include "config.h"
 #include "rpcbind.h"

=20

#4 lore raw

PATCH 3/5 rpcbind: Squelch a compiler warning

In reply to a message not in the archive

Remove 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
index afd949b..0170f65 100644
@@ -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);
#5 lore raw

PATCH 4/5 rpcbind: Squelch make warnings

In reply to a message not in the archive

Eliminate 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
index d66b43f..cc0a85b 100644
@@ -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                       
      
#6 lore raw

PATCH 5/5 rpcbind: Squelch autotool warning

In reply to a message not in the archive

Change 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
index 69f4169..d529ea5 100644
@@ -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 ;;
#7 lore raw
In reply to a message not in the archive
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.