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, Nov 2, 2:47 AM
Unknown Object (File)
Sep 15 2024, 7:16 AM
Unknown Object (File)
Sep 15 2024, 7:16 AM
Unknown Object (File)
Sep 13 2024, 8:39 PM
Unknown Object (File)
Sep 5 2024, 5:05 AM
Unknown Object (File)
Sep 4 2024, 1:38 PM
Unknown Object (File)
Aug 24 2024, 11:48 AM
Unknown Object (File)
Aug 23 2024, 2:40 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