HPLIP 0.9.5: uninitialised variable bug

Tim Waugh <[email protected]> Mon, 3 Oct 2005 13:16:31 +0100
Newsgroups gmane.linux.drivers.hpofficejet.devel
Message-ID <[email protected]>
--uQr8t48UFsdbeI+V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

This warning:

io/hpiod/uppdevice.cpp:192: warning: 'mode' is used uninitialized in
this function

corresponds to this function:

Channel *UniParDevice::NewChannel(unsigned char sockid)
{
   Channel *pC=3DNULL;
   int i, mode;

   /* Only support one channel. */
   if (ChannelCnt >=3D 1)
      goto bugout;

   /* Look for unused slot in channel array. Note, slot 0 is unused. */
   for (i=3D1; i<MAX_CHANNEL; i++)
   {
      if (pChannel[i] =3D=3D NULL)
      {
         pC =3D new RawChannel(this);  /* constructor sets ClientCnt=3D1 */
         pC->SetIndex(i);
         pC->SetSocketID(sockid);
         pChannel[i] =3D pC;
         ChannelCnt++;
         ChannelMode =3D mode;
         break;
      }
   }    =20

bugout:
   return pC;
}

As you can see, 'mode' is indeed never initialised.  What is meant to
happen here?

Tim.
*/

--uQr8t48UFsdbeI+V
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDQSEfLF+LYaF94FERAvPGAKCesSyUqf7YT48RM9XsAi6bpuPHPwCfdOE7
ReWQ2tfQNprpY6VB+XVBHqo=
=jvbD
-----END PGP SIGNATURE-----

--uQr8t48UFsdbeI+V--


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl