Bug 169189 - compiler notices dodgy code
Summary: compiler notices dodgy code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kdegraphics
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-09-24 11:20 UTC by David Binderman
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-07 11:09:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Binderman 2005-09-24 11:20:01 UTC
Description of problem:
I just tried to compile Fedora development package kdegraphics-3.4.2-5
with the extra compiler flag -Wall.

The compiler said

kpcursorlightcross.cpp:75: warning: 'colorValue' is used uninitialized in this
function

The source code is

    if (colorValue)
        colorBitmap [y * (width / 8) + (x / 8)] |= (1 << (x % 8));

There seems to be a missing default section in the previous switch statement.

Suggest initialise the local variable "colorValue" at its declaration
to make the code bulletproof and to shut the compiler up.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Than Ngo 2006-02-07 11:09:21 UTC
it's now fixed in 3.5.1-2. Thanks for your report.


Note You need to log in before you can comment on or make changes to this bug.