From: Steve Dickson <SteveD@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs-utils: Fix C aliasing rules violation in nfs_getrpccaller()
Date: Mon, 19 Jul 2010 10:10:40 -0400 [thread overview]
Message-ID: <4C445CE0.2030707@RedHat.com> (raw)
In-Reply-To: <20100706165849.4436.13124.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
On 07/06/2010 12:59 PM, Chuck Lever wrote:
> Squelch compiler warnings reported with -Wextra:
>=20
> In file included from statd.c:24:
> ../../support/include/rpcmisc.h: In function =E2=80=98nfs_getrpccalle=
r_in=E2=80=99:
> ../../support/include/rpcmisc.h:58: warning: dereferencing type-punne=
d
> pointer might break strict-aliasing rules
> ../../support/include/rpcmisc.h: In function =E2=80=98nfs_getrpccalle=
r=E2=80=99:
> ../../support/include/rpcmisc.h:63: warning: dereferencing type-punne=
d
> pointer might break strict-aliasing rules
>=20
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> Steve-
>=20
> This minor clean-up patch has been floating around in my repo for a
> while. Please consider applying it for the next release of nfs-utils=
=2E
Committed...=20
steved.
>=20
>=20
> support/include/rpcmisc.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>=20
> diff --git a/support/include/rpcmisc.h b/support/include/rpcmisc.h
> index 1b8f411..c5847fa 100644
> --- a/support/include/rpcmisc.h
> +++ b/support/include/rpcmisc.h
> @@ -60,12 +60,12 @@ extern int _rpcsvcdirty;
> =20
> static inline struct sockaddr_in *nfs_getrpccaller_in(SVCXPRT *xprt)
> {
> - return (struct sockaddr_in *)svc_getcaller(xprt);
> + return (struct sockaddr_in *)(char *)svc_getcaller(xprt);
> }
> =20
> static inline struct sockaddr *nfs_getrpccaller(SVCXPRT *xprt)
> {
> - return (struct sockaddr *)svc_getcaller(xprt);
> + return (struct sockaddr *)(char *)svc_getcaller(xprt);
> }
> =20
> #endif /* RPCMISC_H */
>=20
prev parent reply other threads:[~2010-07-19 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-06 16:59 [PATCH] nfs-utils: Fix C aliasing rules violation in nfs_getrpccaller() Chuck Lever
[not found] ` <20100706165849.4436.13124.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2010-07-19 14:10 ` Steve Dickson [this message]
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=4C445CE0.2030707@RedHat.com \
--to=steved@redhat.com \
--cc=chuck.lever@oracle.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.