linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dib0700_core.c: uninitialized variable warning, not sure how to fix
@ 2016-11-10  7:49 Hans Verkuil
  2016-11-10 10:57 ` Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2016-11-10  7:49 UTC (permalink / raw)
  To: Linux Media Mailing List, Mauro Carvalho Chehab

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.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-10 10:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).