Closed Bug 2069468 Opened 2 months ago Closed 2 months ago

Fix clang 23 unused warnings in gfx

Categories

(Core :: Graphics, task)

task

Tracking

()

RESOLVED FIXED
157 Branch
Tracking Status
firefox157 --- fixed

People

(Reporter: RyanVM, Assigned: RyanVM)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

clang 23.1.0 puts -Wunused-template under -Wall and nests -Wunused-but-set-global under -Wunused-but-set-variable. The gfx sites:

gfx/tests/gtest/TestTreeTraversal.cpp:1269:21: error: unused function template 'DepthFirstSearchForwardRecursive' [-Werror,-Wunused-template]

Eight function templates (DepthFirstSearchForwardRecursive and friends) and six node-setup functors were the reference implementations for the MOZ_GTEST_BENCH benchmarks that bug 1323238 disabled in 2017; nothing has referenced them since. Remove the dead tail after the last test and the <queue> and nsRect.h includes only it used. FindPtrOrNull in dom/canvas/WebGLFormats.cpp is another unused template; remove it.

Three write-only statics have a reason to exist: sBackgroundHangMonitor in gfx/webrender_bindings/RenderThread.cpp and gfx/ipc/CanvasRenderThread.cpp is stored only to keep the monitor alive, and sIndent in gfx/layers/wr/WebRenderCommandBuilder.cpp is only read by disabled debug output. Mark those [[maybe_unused]].

Summary: Remove the leftover microbenchmark helpers from TestTreeTraversal.cpp to fix -Wunused-template with clang 23 → Fix clang 23 unused warnings in gfx

TestTreeTraversal.cpp's leftover microbenchmark helpers and WebGLFormats.cpp's FindPtrOrNull have no
callers. The BackgroundHangMonitor pointers in RenderThread.cpp and CanvasRenderThread.cpp are only stored
to keep the monitors alive, and WebRenderCommandBuilder.cpp's sIndent is only read by disabled debug
output, so mark them maybe_unused.

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
QA Whiteboard: [qa-triage-done-c158/b157]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: