Last Comment Bug 661969 - GCC 4.6 build warning: "gfxFontUtils.h:874:18: warning: variable ‘timerInterval’ set but not used [-Wunused-but-set-variable]"
: GCC 4.6 build warning: "gfxFontUtils.h:874:18: warning: variable ‘timerInterv...
Status: VERIFIED FIXED
[build_warning][inbound]
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla7
Assigned To: Daniel Holbert [:dholbert]
:
Mentors:
Depends on:
Blocks: 419744
  Show dependency treegraph
 
Reported: 2011-06-03 16:05 PDT by Daniel Holbert [:dholbert]
Modified: 2011-08-29 05:35 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix: remove variable (1.30 KB, patch)
2011-06-22 20:18 PDT, Daniel Holbert [:dholbert]
no flags Details | Diff | Review
fix v2 (942 bytes, patch)
2011-06-23 11:19 PDT, Daniel Holbert [:dholbert]
jd.bugzilla: review+
Details | Diff | Review

Description Daniel Holbert [:dholbert] 2011-06-03 16:05:03 PDT
When building with GCC 4.6, every file that #includes gfxFontUtils.h spams this warning:

{
gfxFontUtils.h: In member function ‘void gfxFontInfoLoader::StartLoader(PRUint32, PRUint32)’:
gfxFontUtils.h:874:18: warning: variable ‘timerInterval’ set but not used [-Wunused-but-set-variable]
}

From looking at the involved code, it looks like the variable's been unused ever since this code was added, in bug 419744.  Here's the relevant code snippet:
{
874         PRUint32 timerInterval;
875 
876         if (aDelay) {
877             mState = stateTimerOnDelay;
878             timerInterval = aDelay;
879         } else {
880             mState = stateTimerOnInterval;
881             timerInterval = mInterval;
882         }
883 
884         InitLoader();
885 
886         // start timer
887         mTimer->InitWithFuncCallback(LoaderTimerCallback, this, aDelay, 
888                                      nsITimer::TYPE_REPEATING_SLACK);
}
http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxFontUtils.h#873

John, do you know if we should be using this variable somewhere?  Or can it just go away?
Comment 1 Daniel Holbert [:dholbert] 2011-06-22 20:18:29 PDT
Created attachment 541273 [details] [diff] [review]
fix: remove variable

Here's a patch to just delete the variable, since it's apparently not used.
Comment 2 Daniel Holbert [:dholbert] 2011-06-22 20:25:58 PDT
(In reply to comment #0)
> When building with GCC 4.6, every file that #includes gfxFontUtils.h spams
> this warning

To be specific -- we spam this warning at least 75 distinct times during a mozilla-central build (with sometimes 6 or more lines of output per warning, to print the sequence of .h #includes from the .cpp file to gfxFontUtils.h via other headers).

So, fixing this will fix hundreds of lines of gcc-4.6 warning output.
Comment 3 John Daggett (:jtd) 2011-06-22 20:31:58 PDT
Comment on attachment 541273 [details] [diff] [review]
fix: remove variable

Actually, this is a bug.  The logic is intended to support an initial delay with a separate interval value.  So the right fix is to pass timerInterval instead of aDelay into the call to InitWithFuncCallback.  StartLoader is always called with a delay so the bug doesn't really affect much but best to fix it.
Comment 4 Daniel Holbert [:dholbert] 2011-06-23 11:19:25 PDT
Created attachment 541441 [details] [diff] [review]
fix v2

Ah, makes sense. Here's a patch to do that.
Comment 5 Daniel Holbert [:dholbert] 2011-06-23 19:02:51 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/ee78f62ded1c
Comment 6 Marco Bonardo [::mak] 2011-06-24 02:57:53 PDT
http://hg.mozilla.org/mozilla-central/rev/ee78f62ded1c
Comment 7 Mihaela Velimiroviciu (:mihaelav) 2011-08-29 05:35:05 PDT
Verified the fix in hg.mozilla.org/mozilla-central under gfx/thebes/gfxFontUtils.h: timerInterval variable is set and used.

Changing resolution to VERIFIED-FIXED.

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