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
Unknown Object (File)
Wed, Oct 15, 7:33 AM
Unknown Object (File)
Wed, Oct 15, 7:33 AM
Unknown Object (File)
Tue, Oct 14, 9:21 PM
Unknown Object (File)
Thu, Oct 2, 1:51 AM
Unknown Object (File)
Tue, Sep 30, 3:27 AM
Unknown Object (File)
Tue, Sep 30, 3:22 AM
Unknown Object (File)
Mon, Sep 29, 11:21 PM
Unknown Object (File)
Mon, Sep 29, 11:51 AM
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