Closed Bug 59676 Opened 19 years ago Closed 8 years ago

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

Categories

(Core :: XUL, defect, P4)

defect

Tracking

()

RESOLVED WORKSFORME
mozilla1.0.1

People

(Reporter: rich.burridge, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

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 XPToolkit/
Widget module:

/widget/src/xlib/nsClipboard.cpp
nsClipboard.cpp:577: warning: `PRUnichar * unicodeData' might be used
uninitialized in this function
nsClipboard.cpp:620: warning: `PRUnichar * unicodeData' might be used
uninitialized in this function
----
nsSound.cpp:136: warning: `long int rate' might be used uninitialized in this
function
nsSound.cpp:137: warning: `int bits_per_sample' might be used uninitialized in
this function
----
nsWidget.cpp:1689: warning: `gint x' might be used uninitialized in this
function
nsWidget.cpp:1689: warning: `gint y' might be used uninitialized in this
function
----
nsWindow.cpp:2252: warning: `nsresult result' might be used uninitialized in
this function
----
Blocks: 59652
Should really be separate bugs, but I'll give this to Pink to fix clipboard and
pass along to the next owner. P4/Moz0.8
Assignee: trudelle → pinkerton
Priority: P3 → P4
Target Milestone: --- → mozilla0.8
ok, well, the clipboard file referenced here doesn't have the given lines (it
only has 406), so I don't know what is going on. pushing off to the next person
on the list (which would be pav).
Assignee: pinkerton → pavlov
Status: NEW → ASSIGNED
Target Milestone: mozilla0.8 → mozilla0.9.1
Target Milestone: mozilla0.9.1 → mozilla1.0
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
Current (http://tinderbox.mozilla.org/SeaMonkey/warn1013026020.23864.html - Wed,
06 Feb 2002 15:07 EST) warnings in widget/src:

widget/src/cocoa/nsClipboard.cpp:606
 `PRUnichar * unicodeData' might be used uninitialized in this function

widget/src/cocoa/nsClipboard.cpp:651
 `PRUnichar * unicodeData' might be used uninitialized in this function

widget/src/cocoa/nsSound.cpp:142
 `long int rate' might be used uninitialized in this function

widget/src/cocoa/nsSound.cpp:143
 `int bits_per_sample' might be used uninitialized in this function

widget/src/xlib/nsWidget.cpp:1584
 `gint x' might be used uninitialized in this function
 `gint y' might be used uninitialized in this function
Keywords: mozilla1.0
Summary: Occurances of uninitialized variables being used before being set. → Occurances of uninitialized variables being used before being set (widget/src)
The last warning is only listed as widget/src/xlib/nsWidget.cpp because of TBox
bug 124614. In reality it's widget/src/gtk/nsWidget.cpp. There something weird
is goind on - the same values are assigned twice for no good reason...
If aGdkMotionEvent is non-NULL, event.point.x and event.point.y would already
be set earlier, so setting them again (to the same exact thing) does not make
much sense. I am missing anything?
Keywords: patch, review
Attachment #70338 - Flags: superreview?
Attachment #70338 - Flags: review?
Comment on attachment 70338 [details] [diff] [review]
Remove redundant code, get rid of warnings

You are right.	In the future, for faster response, ask specific people for
review and super review.  Ask around on #mozilla.
Attachment #70338 - Flags: superreview?(bryner)
Attachment #70338 - Flags: superreview?
Attachment #70338 - Flags: review?
Attachment #70338 - Flags: review+
Attachment #70338 - Flags: superreview?(bryner) → superreview+
Comment on attachment 70338 [details] [diff] [review]
Remove redundant code, get rid of warnings

Can somebody check this in (I do not have CVS access)? Thanks a lot!
Flags: wanted1.3a?
Attachment #70338 - Flags: in?
Attachment #70338 - Flags: checked
We're not going to hold 1.3a for this. That doesn't mean that the fix won't be
included in 1.3a. (The "wanted1.3a" flag has been changed to "blocking1.3a" to
more accurately reflect how the flag is used by drivers@mozilla.org). 
Flags: blocking1.3a? → blocking1.3a-
Comment on attachment 70338 [details] [diff] [review]
Remove redundant code, get rid of warnings

Patch checked in. I don't know if the bug should be closed so can you do it,
Aleksey?
Attachment #70338 - Flags: checkin?
Comment on attachment 70338 [details] [diff] [review]
Remove redundant code, get rid of warnings

brad TBox shows the following "uninitialized" warnings left in widget/src:

widget/src/gtk/nsClipboard.cpp:609
 `PRUnichar * unicodeData' might be used uninitialized in this function

widget/src/gtk/nsClipboard.cpp:654
 `PRUnichar * unicodeData' might be used uninitialized in this function

widget/src/gtk/nsSound.cpp:142
 `long int rate' might be used uninitialized in this function

widget/src/gtk/nsSound.cpp:143
 `int bits_per_sample' might be used uninitialized in this function
Attachment #70338 - Attachment is obsolete: true
Attached patch fix warningsSplinter Review
Summary: Occurances of uninitialized variables being used before being set (widget/src) → Occurences of uninitialized variables being used before being set (widget/src)
I also see:

d:/mozilla/mozilla/widget/src/windows/nsDataObj.cpp:82: warning: `CLSID_nsDataOb
j' initialized and declared `extern'
d:/mozilla/mozilla/widget/src/windows/nsDataObj.cpp:82: warning: `__cdecl__' att
ribute only applies to function types
d:/mozilla/mozilla/widget/src/windows/nsDataObj.cpp: In function `void MangleTex
tToValidFilename(nsString&)':
d:/mozilla/mozilla/widget/src/windows/nsDataObj.cpp:519: warning: comparison bet
ween signed and unsigned integer expressions
d:/mozilla/mozilla/widget/src/windows/nsDataObj.cpp:523: warning: comparison bet
ween signed and unsigned integer expressions

{standard input}:2767: Warning: Ignoring changed section attributes for .text
d:/mozilla/mozilla/widget/src/windows/nsDataObjCollection.cpp:62: warning: `CLSI
D_nsDataObjCollection' initialized and declared `extern'
d:/mozilla/mozilla/widget/src/windows/nsDataObjCollection.cpp:62: warning: `__cd
ecl__' attribute only applies to function types

d:/mozilla/mozilla/widget/src/windows/nsClipboard.cpp: In static member function
 `static PRBool nsClipboard::FindPlatformHTML(IDataObject*, UINT, void**, PRUint
32*)':
d:/mozilla/mozilla/widget/src/windows/nsClipboard.cpp:684: warning: int format,
PRUint32 arg (arg 4)
d:/mozilla/mozilla/widget/src/windows/nsClipboard.cpp:684: warning: int format,
PRUint32 arg (arg 5)

Assignee: pavlov → jag
Status: ASSIGNED → NEW
QA Contact: jrgmorrison → xptoolkit.widgets
Assignee: jag → nobody
Surprisingly, there is no warning at all in the widget/src code (using gcc4.6.1 on linux).
Hence closing this bug.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.