Page MenuHomeFreeBSD

[nvmecontrol] Fix type signedness warning-to-error on gcc-6.4
ClosedPublic

Authored by adrian on Oct 15 2020, 4:45 AM.
Tags
None
Referenced Files
F159430092: D26791.id79518.diff
Sat, Jun 13, 11:45 PM
Unknown Object (File)
Fri, Jun 12, 5:54 AM
Unknown Object (File)
Thu, Jun 11, 11:27 PM
Unknown Object (File)
Wed, Jun 10, 3:44 AM
Unknown Object (File)
Wed, Jun 10, 3:44 AM
Unknown Object (File)
Wed, Jun 10, 2:41 AM
Unknown Object (File)
Sat, May 23, 5:07 AM
Unknown Object (File)
Apr 29 2026, 6:05 PM
Subscribers

Details

Summary

This fixes a type signedness comparison warning-to-error on
gcc-6.4. The ternary operation casts it right but the actual
assignment doesn't.

Test Plan
  • compiled on gcc-6.4 amd64

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 34784
Build 31833: arc lint + arc unit

Event Timeline

sbin/nvmecontrol/firmware.c
181

I think it would be better to have a new variable that's the right size rather than all the casts.

Updated to reduce casting and use better variable types

Whoops, remove another cast

adrian marked an inline comment as done.
This revision is now accepted and ready to land.Nov 16 2020, 4:42 AM