[ovs-dev] [PATCH ovn] pinctrl.c: Fix maybe-uninitialized warnings.

Han Zhou hzhou at ovn.org
Thu Oct 31 18:49:08 UTC 2019

On Thu, Oct 31, 2019 at 9:21 AM Ben Pfaff <blp at ovn.org> wrote:
> On Wed, Oct 30, 2019 at 02:26:27PM -0700, Han Zhou wrote:
> > ../controller/pinctrl.c: In function ‘ipv6_ra_send’:
> > ../controller/pinctrl.c:2393:13: error: ‘r1’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
> >              memcpy(&dnssl[i], t1, strlen(t1));
> >              ^
> This is weird: the message is about r1 but the line of code it cites
> does not mention r1.  Is there some macro trickery or something else
> unusual going on?

Yes, it's weird. I think this is a bug of gcc that it complained in the
wrong line. The real line with the use of r1 is in the for() line. If I
remove the memcpy() line, the error just reports the next line, and it
disappears when I remove all lines in the for block.

More information about the dev mailing list