RESOLVED FIXED 6153
build failure after WebTextRenderer patch, uninitialized variables
https://bugs.webkit.org/show_bug.cgi?id=6153
Summary build failure after WebTextRenderer patch, uninitialized variables
Justin Garcia
Reported 2005-12-19 18:40:59 PST
Deployment catches a few uninitialized variables in your recent patch: /Users/justin/Labyrinth/WebKit/WebCoreSupport.subproj/WebTextRenderer.m: In function 'createATSULayoutParameters': /Users/justin/Labyrinth/WebKit/WebCoreSupport.subproj/WebTextRenderer.m:1314: warning: 'firstSmallCap' may be used uninitialized in this function /Users/justin/Labyrinth/WebKit/WebCoreSupport.subproj/WebTextRenderer.m:1292: warning: 'substituteRenderer' may be used uninitialized in this function I couldn't figure out why firstSmallCap was uninitialized: UniCharArrayOffset firstSmallCap; if (i == substituteOffset || i == substituteOffset + substituteLength) { if (isSmallCap) { isSmallCap = false; initializeATSUStyle(getSmallCapsRenderer(r)); ATSUSetRunStyle(layout, getSmallCapsRenderer(r)->_ATSUStyle, firstSmallCap, i - firstSmallCap); } firstSmallCap is an argument to ATSUSetRunStyle, not as a ref or anything, but as a value. Initializing it to 0 made one of the layout tests you added fail.
Attachments
Build fix (2.07 KB, patch)
2005-12-19 22:25 PST, mitz
darin: review+
fix more uninitialized variable warnings (1.07 KB, patch)
2005-12-20 13:15 PST, mitz
ggaren: review+
mitz
Comment 1 2005-12-19 22:25:38 PST
Created attachment 5169 [details] Build fix Sorry about the bug! Darin actually warned me about uninitialized variable warnings in another part of that patch, but I didn't know that I have to test a deployment build. These initial values are never used: firstSmallCap is only used when isSmallCap is true, and whenever isSmallCap is set to true, firstSmallCap is set; substituteRenderer is only used if substituteLength > 0, in which case substituteRenderer is set.
Darin Adler
Comment 2 2005-12-20 09:10:00 PST
Comment on attachment 5169 [details] Build fix r=me
mitz
Comment 3 2005-12-20 13:15:11 PST
Created attachment 5189 [details] fix more uninitialized variable warnings These are the ones Darin warned me about. Why do they generate warnings only in deployment configuration?
Justin Garcia
Comment 4 2005-12-20 13:36:38 PST
Apparently gcc warns about uninitialized variables when any sort of optimizations are turned on. Tim H. is looking into a way to turn these warnings on in Development mode w/o enabling optimizations.
Geoffrey Garen
Comment 5 2005-12-20 13:45:06 PST
Comment on attachment 5189 [details] fix more uninitialized variable warnings r=me
Note You need to log in before you can comment on or make changes to this bug.