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)
Mar 7 2024, 6:07 PM
Unknown Object (File)
Feb 20 2024, 7:53 PM
Unknown Object (File)
Feb 20 2024, 7:53 PM
Unknown Object (File)
Feb 12 2024, 12:37 AM
Unknown Object (File)
Jan 10 2024, 3:37 AM
Unknown Object (File)
Dec 16 2023, 3:20 AM
Unknown Object (File)
Dec 14 2023, 6:34 AM
Unknown Object (File)
Oct 27 2023, 2:20 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45005
Build 41893: arc lint + arc unit

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

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 ↗(On Diff #104633)

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 ↗(On Diff #104633)

agreed.

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

just commit and mess with it later