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
F106038127: D7699.diff
Tue, Dec 24, 7:15 AM
Unknown Object (File)
Fri, Dec 20, 9:29 AM
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
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.