[sheepdog] [PATCH] corosync: fix a compiler warning

Jinzhi Chen nxtjinzhi at gmail.com
Mon Nov 3 03:27:49 CET 2014


root at hty-compute2:~# /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.15-0ubuntu10.5) stable release* version 2.15*,
by Roland McGrath et al.
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by* GNU CC version 4.6.3*.
Compiled on a Linux 3.2.50 system on 2013-09-30.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
root at hty-compute2:~#



On Fri, Oct 31, 2014 at 4:00 PM, Hitoshi Mitake <
mitake.hitoshi at lab.ntt.co.jp> wrote:

> At Fri, 31 Oct 2014 10:28:34 +0800,
> Jinzhi Chen wrote:
> >
> > [1  <multipart/alternative (7bit)>]
> > [1.1  <text/plain; UTF-8 (quoted-printable)>]
> > this problem still exits in the master branch,
> > seems not merged into master or devel branch
>
> On my environment, the warning messages cannot be seen. Could you
> provide information of your environment (e.g. glibc version?)?
>
> Thanks,
> Hitoshi
>
> >
> > On Tue, Oct 14, 2014 at 4:13 PM, Liu Yuan <namei.unix at gmail.com> wrote:
> >
> > > Fix following warning:
> > >
> > > ...
> > > cluster/corosync.c: In function ‘corosync_get_local_addr’:
> > > cluster/corosync.c:132:22: warning: declaration of ‘sin’ shadows a
> global
> > > declaration [-Wshadow]
> > >   CCLD   sheep
> > > make[1]: Leaving directory `/home/test/sheepdog/sheep'
> > > ...
> > >
> > > Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> > > ---
> > >  sheep/cluster/corosync.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/sheep/cluster/corosync.c b/sheep/cluster/corosync.c
> > > index f876112..b7fc025 100644
> > > --- a/sheep/cluster/corosync.c
> > > +++ b/sheep/cluster/corosync.c
> > > @@ -129,7 +129,7 @@ static int corosync_get_local_addr(uint8_t *addr)
> > >         int ret, nr;
> > >         corosync_cfg_node_address_t caddr;
> > >         struct sockaddr_storage *ss = (struct sockaddr_storage
> > > *)caddr.address;
> > > -       struct sockaddr_in *sin = (struct sockaddr_in *)caddr.address;
> > > +       struct sockaddr_in *sin4 = (struct sockaddr_in *)caddr.address;
> > >         struct sockaddr_in6 *sin6 = (struct sockaddr_in6
> *)caddr.address;
> > >         void *saddr;
> > >
> > > @@ -149,7 +149,7 @@ static int corosync_get_local_addr(uint8_t *addr)
> > >                 saddr = &sin6->sin6_addr;
> > >                 memcpy(addr, saddr, 16);
> > >         } else if (ss->ss_family == AF_INET) {
> > > -               saddr = &sin->sin_addr;
> > > +               saddr = &sin4->sin_addr;
> > >                 memset(addr, 0, 16);
> > >                 memcpy(addr + 12, saddr, 4);
> > >         } else {
> > > --
> > > 1.9.1
> > >
> > > --
> > > sheepdog mailing list
> > > sheepdog at lists.wpkg.org
> > > http://lists.wpkg.org/mailman/listinfo/sheepdog
> > >
> > [1.2  <text/html; UTF-8 (quoted-printable)>]
> >
> > [2  <text/plain; us-ascii (7bit)>]
> > --
> > sheepdog mailing list
> > sheepdog at lists.wpkg.org
> > http://lists.wpkg.org/mailman/listinfo/sheepdog
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20141103/3a708079/attachment-0003.html>


More information about the sheepdog mailing list