Page MenuHomeFreeBSD

LinuxKPI: avoid -Werror=unused-value in sort() from BUILD_BUG_ON_ZERO()
AcceptedPublic

Authored by bz on Fri, Feb 27, 4:56 AM.
Tags
None
Referenced Files
F146136700: D55554.id.diff
Sat, Feb 28, 3:22 AM
F146076338: D55554.id172838.diff
Fri, Feb 27, 2:44 PM
F146071582: D55554.id.diff
Fri, Feb 27, 1:42 PM
F146071419: D55554.id172838.diff
Fri, Feb 27, 1:40 PM
Subscribers

Details

Reviewers
jhb
emaste
Group Reviewers
linuxkpi
Summary

The BUILD_BUG_ON_ZERO() macro returns an (int)0 if it does not fail
at build time. LinuxKPI sort() has it as a guard for an unsupported
argument but ignores the return value.
This leads to gcc complaining:
error: statement with no effect [-Werror=unused-value]
Cast the result to (void) to silence the error as we are not interested
in it.

Reported by: CI
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 71053
Build 67936: arc lint + arc unit