Page MenuHomeFreeBSD

Silence several set but not used variables, spotted by CLANG.

Authored by araujo on May 31 2015, 2:02 PM.


Test Plan

Build using: make tinderbox

Diff Detail

rS FreeBSD src repository
Lint OK
No Unit Test Coverage

Event Timeline

araujo retitled this revision from to Silence several set but not used variables, spotted by CLANG..May 31 2015, 2:02 PM
araujo updated this object.
araujo edited the test plan for this revision. (Show Details)
araujo updated this revision to Diff 5833.
araujo updated this object.May 31 2015, 2:04 PM
araujo edited the test plan for this revision. (Show Details)
araujo added reviewers: rodrigc, emaste, bapt.
bapt added a reviewer: kib.May 31 2015, 2:06 PM
kib edited edge metadata.EditedMay 31 2015, 3:29 PM
kib requested changes to this revision.

The goal of the work to remove warnings is to improve the code, not to shut up the compiler. For 'unused local variables' warnings, this means that each case must be analyzed and either unused variable is useless and must be removed, or there is a coding error which resulted in the needed calculation being ignored.

The patch silences the warnings and hides either cosmetic or serious errors. As such, it is wrong. Better leave the warning around for somebody else to do real investigation.

P.S. Probably, the only non-hackish use of the unused attribute is to mark the unused arguments of an implementation of the externally-specified interface. One of the best examples are argc/argv main()' arguments in the hosted program which does not take any cmd line args. Local vars must almost never be unused.

This revision now requires changes to proceed.May 31 2015, 3:29 PM

Got the point! I'm gonna keep this review request until I can verify case by case and submit in different review requests to finish these changes specified here.


rodrigc edited edge metadata.Dec 18 2015, 8:07 PM
rodrigc requested changes to this revision.

I agree with @kib. I don't like this patch in its current form.

emaste added inline comments.Dec 18 2015, 8:23 PM

This one for example looks like it came from a similar structure as convert_wccl above and should be deleted; perhaps convert_wccl should also drop wcp0 and use n++.

araujo abandoned this revision.Jan 18 2016, 6:37 AM

Not interested on it anymore...