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
Unknown Object (File)
Fri, May 30, 5:01 PM
Unknown Object (File)
Fri, May 23, 5:34 AM
Unknown Object (File)
Mon, May 5, 7:34 PM
Unknown Object (File)
Apr 27 2025, 3:01 PM
Unknown Object (File)
Apr 26 2025, 5:04 AM
Unknown Object (File)
Apr 11 2025, 7:43 AM
Unknown Object (File)
Mar 25 2025, 1:33 PM
Unknown Object (File)
Mar 21 2025, 1:19 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

sbin/nvmecontrol/firmware.c
180 ↗(On Diff #78247)

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