Page MenuHomeFreeBSD

suppress set but not used warnings for kernel builds
ClosedPublic

Authored by rew on Apr 4 2022, 11:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 11, 8:19 AM
Unknown Object (File)
Sat, May 11, 8:19 AM
Unknown Object (File)
Thu, May 2, 6:44 PM
Unknown Object (File)
Wed, May 1, 8:03 AM
Unknown Object (File)
Apr 22 2024, 9:31 AM
Unknown Object (File)
Apr 19 2024, 12:16 AM
Unknown Object (File)
Mar 7 2024, 6:07 PM
Unknown Object (File)
Feb 20 2024, 7:53 PM
Subscribers
Tokens
"Like" token, awarded by mhorne.

Details

Summary

Turn off set but not used warnings for kernel builds with clang13.

These warnings can be turned back on by setting the following in src.conf:

WITH_SET_BUT_NOTUSED_KERNEL_WARNINGS=

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rew requested review of this revision.Apr 4 2022, 11:46 PM
imp requested changes to this revision.Apr 5 2022, 12:07 AM

this breaks boostrapping

sys/conf/kmod.mk
119 ↗(On Diff #104593)

use ${NO_WUNUSED_BUT_SET_VARIABLE} instead.

This revision now requires changes to proceed.Apr 5 2022, 12:07 AM

feedback from imp: use ${NO_WUNUSED_BUT_SET_VARIABLE}

I have ~65 changes in my queue to eliminate all the trivial errors for the arm kernel build.
I plan on pushing them shortly, and there may be some overlap with your work, but I've finished universe with them...

This revision is now accepted and ready to land.Apr 5 2022, 2:51 AM

Modules get built even if particular code is built-in into the kernel, artificially raising the clang spam.

The fix would be to stop building said modules to begin with.

Taking this review in a different direction..

Build kernel with -Wno-unused-but-set-variable by default.

This revision now requires review to proceed.Apr 5 2022, 6:41 PM
rew retitled this revision from suppress set but not used warnings for kernel modules to suppress set but not used warnings for kernel builds.Apr 5 2022, 6:49 PM
rew edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 5 2022, 7:04 PM
imp added inline comments.
sys/conf/kern.mk
47

I'd be tempted to merge just this one line to stable/13 and not make it an option there.

sys/conf/kern.mk
47

agreed.

...wonder if it'd be better to drop the option now?

just commit and mess with it later