The default bug view has changed. See this FAQ.

GCC 4.6 build warning: "gfxFontUtils.h:874:18: warning: variable ‘timerInterval’ set but not used [-Wunused-but-set-variable]"

VERIFIED FIXED in mozilla7

Status

()

Core
Graphics
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
mozilla7
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning][inbound])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
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?
(Assignee)

Comment 1

6 years ago
Created attachment 541273 [details] [diff] [review]
fix: remove variable

Here's a patch to just delete the variable, since it's apparently not used.
Attachment #541273 - Flags: review?(jdaggett)
(Assignee)

Comment 2

6 years ago
(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

6 years ago
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.
(Assignee)

Comment 4

6 years ago
Created attachment 541441 [details] [diff] [review]
fix v2

Ah, makes sense. Here's a patch to do that.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #541441 - Flags: review?(jdaggett)
(Assignee)

Updated

6 years ago
Attachment #541273 - Attachment is obsolete: true
Attachment #541273 - Flags: review?(jdaggett)

Updated

6 years ago
Attachment #541441 - Flags: review?(jdaggett) → review+
(Assignee)

Comment 5

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/ee78f62ded1c
Whiteboard: [build_warning] → [build_warning][inbound]
http://hg.mozilla.org/mozilla-central/rev/ee78f62ded1c
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
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.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.