All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 4/6] mount.nfs: squelch compiler warning for TI-RPC builds
Date: Wed, 04 Mar 2009 19:02:55 -0500	[thread overview]
Message-ID: <20090305000254.28749.54076.stgit@ingres.1015granger.net> (raw)
In-Reply-To: <20090304234711.28749.7018.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>

The printf format string in nfs_pp_debug() assumes the @program and
@version arguments are unsigned long, because the legacy RPC headers
define both rpcprog_t and rpcvers_t as unsigned long types.

However, the TI-RPC headers define both types as uint32_t, which
requires a different printf format type.  If we replace the legacy
headers with TI-RPC headers, this type mismatch generates compiler
warnings that are nothing but noise.

We are about to provide a switch at ./configure time to allow the use
of either the legacy RPC headers or the TI-RPC headers, so we need
a printf format that works in both cases.

To squelch the compiler warnings that occur when using the TI-RPC
headers, cast both arguments in the fprintf statement to the widest of
the two types ("unsigned long" or "uint32_t").

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mount/network.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index b41388e..bcd0c0f 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -546,8 +546,9 @@ static void nfs_pp_debug(const struct sockaddr *sap, const socklen_t salen,
 		strcat(buf, "unknown host");
 	}
 
-	fprintf(stderr, _("%s: trying %s prog %ld vers %ld prot %s port %d\n"),
-			progname, buf, program, version,
+	fprintf(stderr, _("%s: trying %s prog %lu vers %lu prot %s port %d\n"),
+			progname, buf, (unsigned long)program,
+			(unsigned long)version,
 			(protocol == IPPROTO_UDP ? _("UDP") : _("TCP")),
 			port);
 }


  parent reply	other threads:[~2009-03-05  0:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05  0:02 [PATCH 0/6] Further nfs-utils clean ups Chuck Lever
     [not found] ` <20090304234711.28749.7018.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-03-05  0:02   ` [PATCH 1/6] nfs-utils: Replace getservbyname(3) Chuck Lever
2009-03-05  0:02   ` [PATCH 2/6] configure: Remove CPPFLAGS substitution Chuck Lever
2009-03-05  0:02   ` [PATCH 3/6] nfs-utils: Provide type-checked version of svc_getcaller() Chuck Lever
2009-03-05  0:02   ` Chuck Lever [this message]
2009-03-05  0:03   ` [PATCH 5/6] gssd: Use same style for including config.h that rest of nfs-utils uses Chuck Lever
2009-03-05  0:03   ` [PATCH 6/6] gssd: include gssapi/gssapi.h before write_bytes.h Chuck Lever
2009-03-05 11:26   ` [PATCH 0/6] Further nfs-utils clean ups 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=20090305000254.28749.54076.stgit@ingres.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /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.