Page MenuHomeFreeBSD

make logout_req::reason an unsigned char to fix warning setting bit 7
ClosedPublic

Authored by emaste on Aug 29 2016, 7:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 4, 5:00 PM
Unknown Object (File)
Nov 4 2024, 4:26 PM
Unknown Object (File)
Nov 3 2024, 6:59 AM
Unknown Object (File)
Nov 3 2024, 6:58 AM
Unknown Object (File)
Nov 3 2024, 6:50 AM
Unknown Object (File)
Nov 3 2024, 6:47 AM
Unknown Object (File)
Sep 18 2024, 1:51 PM
Unknown Object (File)
Sep 18 2024, 1:51 PM
Subscribers
None

Details

Summary

Based on context it appears reason should be an unsigned 8-bit field.

/tank/emaste/src/freebsd-clang-import/sbin/iscontrol/fsm.c:612:25: error: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
     p->reason = BIT(7) | 0;
               ~ ~~~~~~~^~~
1 error generated.
*** [fsm.o] Error code 1 (ignored)

Oddly I can't find any user of logout_req(_t)? other than the one in sbin/iscontrol/fsm.c

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to make logout_req::reason an unsigned char to fix warning setting bit 7.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: dim, trasz.

It looks good to me, but I'm not sure if there are other consumers of this header, which rely on the fields? Then again, u_char is clearly the right type here.

This revision was automatically updated to reflect the committed changes.