Page MenuHomeFreeBSD

fbt: Fix compiler warnings in CDDL fbt sources.
AcceptedPublic

Authored by khng on Apr 12 2024, 7:51 PM.
Tags
None
Referenced Files
F142155743: D44760.diff
Fri, Jan 16, 1:47 PM
Unknown Object (File)
Sat, Dec 27, 6:52 PM
Unknown Object (File)
Nov 28 2025, 12:59 AM
Unknown Object (File)
Nov 26 2025, 9:18 PM
Unknown Object (File)
Nov 19 2025, 7:45 AM
Unknown Object (File)
Nov 5 2025, 6:11 PM
Unknown Object (File)
Nov 5 2025, 4:11 AM
Unknown Object (File)
Nov 2 2025, 3:17 PM
Subscribers

Details

Reviewers
markj
Summary

Mark unused arguments.

Avoid shadowing global variables.

Void cast the return of functions where the return value is
intentionally being ignored.

Handle signed/unsigned mismatches.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57061
Build 53949: arc lint + arc unit

Event Timeline

khng requested review of this revision.Apr 12 2024, 7:51 PM
zlei added inline comments.
sys/cddl/dev/fbt/fbt.c
442

The global var version is defined as extern char version[]; in sys/sys/system.h, and the implementation is generated by sys/conf/newvers.sh .

Since the global one has a different type char [], I think the shadowing should be easily caught by modern compilers.

PS: I'd prefer the shorter one ver rather than vers. The latter sounds like multiple version[s].

907

The parameter name should be unsigned. No idea why it was defined as int.
@markj
Do you have any clues ?

markj added inline comments.
sys/cddl/dev/fbt/fbt.c
907

I don't know offhand why it's signed. I can't see any (ab)use of that property.

Really the parameter should be size_t.

This revision is now accepted and ready to land.Apr 18 2024, 3:32 PM