Closed Bug 1737217 (-Wunused-but-set-parameter) Opened 2 years ago Closed 2 years ago

Enable -Wunused-but-set-parameter warnings

Categories

(Firefox Build System :: General, task, P3)

task

Tracking

(firefox-esr78 wontfix, firefox-esr91 wontfix, firefox93 wontfix, firefox94 wontfix, firefox95 wontfix, firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox-esr91 --- wontfix
firefox93 --- wontfix
firefox94 --- wontfix
firefox95 --- wontfix
firefox96 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

clang 13 added a new -Wunused-but-set-parameter warning:

https://releases.llvm.org/13.0.0/tools/clang/docs/DiagnosticsReference.html#wunused-but-set-parameter

gcc has had an -Wunused-but-set-parameter since gcc 4.6, though the few warnings I've seen from it were all false positives.

https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Warning-Options.html

Alias: Wunused-but-set-parameter → -Wunused-but-set-parameter
Blocks: buildwarning

This change fixes the following -Wunused-but-set-parameter warning:

netwerk/test/fuzz/FuzzingStreamListener.cpp:18:49: warning: parameter 'aOffset' set but not used [-Wunused-but-set-parameter]

But don't enable on gcc because it reports false positives, such as:

js/src/jsapi-tests/testJitABIcalls.cpp:445:61: warning: parameter 'lineno' set but not used [-Wunused-but-set-parameter]
js/src/jsapi-tests/testJitABIcalls.cpp:461:56: warning: parameter 'base' set but not used [-Wunused-but-set-parameter]

Even though those parameters are used here:

https://searchfox.org/mozilla-central/source/js/src/jsapi-tests/testJitABIcalls.cpp#445,450,461,464

Depends on D129350

Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a9ec3b454039
Stop incrementing aOffset parameter that is never used. r=necko-reviewers,valentin
https://hg.mozilla.org/integration/autoland/rev/9a7479044bb4
Enable -Wunused-but-set-parameter warnings on clang. r=firefox-build-system-reviewers,glandium
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

You need to log in before you can comment on or make changes to this bug.