Fix clang 23 unused warnings in js
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
| 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; it flags internal-linkage templates a translation unit never instantiates. It also nests -Wunused-but-set-global under -Wunused-but-set-variable, so file-scope statics that are written but never read are reported too. SpiderMonkey's -Werror builds fail on:
js/src/gc/Memory.cpp:293:21: error: unused function template 'MapMemoryAtFuzzy' [-Werror,-Wunused-template]
js/src/jsapi-tests/testCompileScript.cpp:20:13: error: unused function template 'dump' [-Werror,-Wunused-template]
plus StringFlagsForCharType in js/src/vm/StringType.cpp (no callers) and xpcshell's reportWarnings flag in js/xpconnect/src/XPCShellImpl.cpp, which -W/-w set but nothing reads.
MapMemoryAtFuzzy is only called from FindAddressLimitInner and MapAlignedPagesRandom, both under #ifdef JS_64BIT, so 32-bit builds (android-arm, win32) never instantiate it; guard the definition the same way. The dump helper came in with bug 1773319 and has never had a caller; remove it and the vm/JSONPrinter.h include it needed. Remove StringFlagsForCharType and reportWarnings; -W and -w stay accepted as no-ops.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
MapMemoryAtFuzzy is only called on 64-bit, so guard it with JS_64BIT. The dump helper in
testCompileScript.cpp and StringFlagsForCharType in StringType.cpp have no callers, and xpcshell's
reportWarnings flag has not been read in years; -W and -w are still accepted as no-ops.
Updated•2 months ago
|
Comment 3•2 months ago
|
||
| bugherder | ||
Comment 4•2 months ago
|
||
| bugherder | ||
Updated•2 months ago
|
Description
•