From: Sean Young <sean@mess.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: dib0700_core.c: uninitialized variable warning, not sure how to fix
Date: Thu, 10 Nov 2016 10:57:41 +0000 [thread overview]
Message-ID: <20161110105741.GA7346@gofer.mess.org> (raw)
In-Reply-To: <aa490920-cb2e-bb3d-a031-f18e6f0ded9b@xs4all.nl>
On Thu, Nov 10, 2016 at 08:49:43AM +0100, Hans Verkuil wrote:
> The daily build produces this compiler warning:
>
> dib0700_core.c: In function 'dib0700_rc_urb_completion':
> dib0700_core.c:787:2: warning: 'protocol' may be used uninitialized in this function [-Wmaybe-uninitialized]
> rc_keydown(d->rc_dev, protocol, keycode, toggle);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> This is indeed correct as there is a path in that function where protocol is
> uninitialized, but I lack the knowledge how this should be fixed.
>
> Mauro, can you take a look?
>
> It goes wrong in the switch in case RC_BIT_NEC if the first 'if' is true.
> Note that keycode is also uninitialized, but it is declared as uninitialized_var(),
> although why you would want to do that instead of just initializing it to 0 or
> something like that is a mystery to me.
This is already solved in this patch:
https://patchwork.linuxtv.org/patch/37516/
Sean
prev parent reply other threads:[~2016-11-10 10:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 7:49 dib0700_core.c: uninitialized variable warning, not sure how to fix Hans Verkuil
2016-11-10 10:57 ` Sean Young [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=20161110105741.GA7346@gofer.mess.org \
--to=sean@mess.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).