Closed Bug 59668 Opened 24 years ago Closed 13 years ago

Occurences of uninitialized variables being used before being set (gfx/src)

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME
mozilla1.0.1

People

(Reporter: rich.burridge, Unassigned)

References

Details

For more details on this problem, see:

http://bugzilla.mozilla.org/show_bug.cgi?id=59652

This bug is just for the warnings in various source files in the GTK
Embedding Widget module:

nsBlender.cpp:267: warning: `PRUint32 srccolor' might be used uninitialized in
this function
nsBlender.cpp:267: warning: `PRUint32 secsrccolor' might be used uninitialized
in this function
nsBlender.cpp:354: warning: `PRUint32 srccolor' might be used uninitialized in
this function
nsBlender.cpp:354: warning: `PRUint32 secsrccolor' might be used uninitialized
in this function
nsBlender.cpp:449: warning: `PRUint16 srccolor' might be used uninitialized in
this function
nsBlender.cpp:449: warning: `PRUint16 secsrccolor' might be used uninitialized
in this function
----
nsFontMetricsGTK.cpp:2112: warning: `class nsFontGTK * p' might be used
uninitialized in this function
----
nsGfxFactoryGTK.cpp:60: warning: `class nsIScriptableRegion * inst' might be
used uninitialized in this function
----
nsImageGTK.cpp:589: warning: `unsigned int pix' might be used uninitialized in
this function
../../../dist/include/nsAReadableString.h:1085: warning: `int whichString' might
be used uninitialized in this function
----
Blocks: 59652
Component: GTK Embedding Widget → Layout
Target Milestone: --- → mozilla1.0
Status: NEW → ASSIGNED
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Currently ( http://tinderbox.mozilla.org/SeaMonkey/warn1013026020.23864.html -
Wed, 06 Feb 2002 15:07) gfx/src has the following warnings:

gfx/src/gtk/nsFontMetricsGTK.cpp:2950
 `class nsFontGTK * p' might be used uninitialized in this function

gfx/src/gtk/nsGfxFactoryGTK.cpp:91
 `class nsIScriptableRegion * inst' might be used uninitialized in this function

gfx/src/gtk/nsImageGTK.cpp:1855
 `PRUint32 alphaStride' might be used uninitialized in this function

gfx/src/gtk/nsImageGTK.cpp:942
 `unsigned int pix' might be used uninitialized in this function

gfx/src/x11shared/nsXFontAAScaledBitmap.cpp:318
 `struct XChar2b * aChar2b' might be used uninitialized in this function
Summary: Occurances of uninitialized variables being used before being set. → Occurances of uninitialized variables being used before being set (gfx/src)
There are only two such warnings left in gfx/src:

1)
gfx/src/gtk/nsGfxFactoryGTK.cpp:91
 `class nsIScriptableRegion * inst' might be used uninitialized in this function

There and uninitialized pointer will be compared to null in rgn is null (this
code was checked in by Blizzard).

2)
gfx/src/gtk/nsImageGTK.cpp:942
 `unsigned int pix' might be used uninitialized in this function

Here, if ximage->bits_per_pixel turns out to be nonsense (e.g. not one of 1, 4,
8, 16, 24 or 32), unpredicatble random things will start happening...

P.S. Trying to make 1.0 as warnings-free as possible...
Keywords: mozilla1.0
Not sure how gfx and gfx2 are related, but here is another one of those:

3)
gfx2/src/gfxImageFrame.cpp:72
 `enum nsMaskRequirements maskReq' might be used uninitialized in this function

There if gfxImageFrame::Init is called with unsupported gfx_format, then
mImage->Init will be called with uninitialized nsMaskRequirements
Summary: Occurances of uninitialized variables being used before being set (gfx/src) → Occurences of uninitialized variables being used before being set (gfx/src)
Depends on: 202594
No longer blocks: 179819
Assignee: pavlov → nobody
Status: ASSIGNED → NEW
QA Contact: pavlov → layout
The only error which remains in gfx/src (using gcc 4.6.1 on linux) is 
mozilla-central/gfx/src/nsDeviceContext.cpp:829:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Hence closing this bug as uninitialized errors does not exists in gfx/src.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.