As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
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...
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla7
Assigned To: Daniel Holbert [:dholbert]
: Milan Sreckovic [:milan]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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;
876         if (aDelay) {
877             mState = stateTimerOnDelay;
878             timerInterval = aDelay;
879         } else {
880             mState = stateTimerOnInterval;
881             timerInterval = mInterval;
882         }
884         InitLoader();
886         // start timer
887         mTimer->InitWithFuncCallback(LoaderTimerCallback, this, aDelay, 
888                                      nsITimer::TYPE_REPEATING_SLACK);

John, do you know if we should be using this variable somewhere?  Or can it just go away?
Comment 1 User image 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 User image 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 User image 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 User image 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 User image Daniel Holbert [:dholbert] 2011-06-23 19:02:51 PDT
Comment 6 User image Marco Bonardo [::mak] 2011-06-24 02:57:53 PDT
Comment 7 User image Mihaela Velimiroviciu (:mihaelav) 2011-08-29 05:35:05 PDT
Verified the fix in 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.