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)
Jan 9 2024, 8:25 PM
Unknown Object (File)
Jan 9 2024, 8:25 PM
Unknown Object (File)
Jan 9 2024, 8:24 PM
Unknown Object (File)
Jan 9 2024, 8:12 PM
Unknown Object (File)
Dec 20 2023, 1:44 AM
Unknown Object (File)
Dec 18 2023, 7:54 PM
Unknown Object (File)
Dec 15 2023, 1:37 AM
Unknown Object (File)
Dec 15 2023, 1:37 AM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.