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)
Sat, May 11, 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
Unknown Object (File)
Apr 12 2024, 8:35 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