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)
Tue, Sep 30, 2:30 PM
Unknown Object (File)
Tue, Sep 16, 9:29 AM
Unknown Object (File)
Aug 6 2025, 6:33 AM
Unknown Object (File)
Jul 27 2025, 5:51 AM
Unknown Object (File)
Jul 27 2025, 5:01 AM
Unknown Object (File)
Jul 22 2025, 7:57 AM
Unknown Object (File)
Jul 1 2025, 10:29 AM
Unknown Object (File)
Jun 29 2025, 6:15 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

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.