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, Jul 10, 4:14 AM
Unknown Object (File)
Sat, Jul 6, 8:35 PM
Unknown Object (File)
Thu, Jun 27, 8:52 PM
Unknown Object (File)
Jun 22 2024, 5:53 AM
Unknown Object (File)
May 11 2024, 6:39 AM
Unknown Object (File)
Apr 26 2024, 5:05 AM
Unknown Object (File)
Apr 16 2024, 3:14 AM
Unknown Object (File)
Apr 14 2024, 5:27 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