Closed Bug 2069467 Opened 2 months ago Closed 2 months ago

Fix clang 23 unused warnings in xpcom

Categories

(Core :: XPCOM, 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. Two sites in xpcom trip them:

xpcom/tests/gtest/TestTArray2.cpp:984:13: error: unused function template 'is_heap' [-Werror,-Wunused-template]

The helper has had nothing to test since bug 1271751 removed the heap functions from nsTArray in 2016; remove it.

gDumpedStatistics in xpcom/base/nsTraceRefcnt.cpp is written unconditionally but only read by a MOZ_ASSERT, so non-debug builds see a write-only global. Move the variable and its write under #ifdef DEBUG alongside the assertion.

Summary: Remove the unused is_heap helper from TestTArray2.cpp to fix -Wunused-template with clang 23 → Fix clang 23 unused warnings in xpcom

TestTArray2.cpp's is_heap helper has no callers, and nsTraceRefcnt.cpp's gDumpedStatistics only exists
for an assertion.

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: