bsnmp: make single bit bitfields unsigned to avoid clang 16 warning
Clang 16 introduced a warning about single bit bitfields in structs, which is triggered by a declaration in bsnmp's snmpd.h: contrib/bsnmp/snmpd/trans_lsock.c:271:21: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] peer->input.stream = 1; ^ ~ Signed one-bit bitfields can only have values -1 and 0, but the intent here is to use the field as a boolean, so make it unsigned. MFC after: 3 days
This commit is contained in:
parent
2ba84b4bcd
commit
b740e02500
@ -152,12 +152,12 @@ struct port_input {
|
||||
int fd; /* socket */
|
||||
void *id; /* evSelect handle */
|
||||
|
||||
int stream : 1; /* stream socket */
|
||||
int cred : 1; /* want credentials */
|
||||
u_int stream : 1; /* stream socket */
|
||||
u_int cred : 1; /* want credentials */
|
||||
|
||||
struct sockaddr *peer; /* last received packet */
|
||||
socklen_t peerlen;
|
||||
int priv : 1; /* peer is privileged */
|
||||
u_int priv : 1; /* peer is privileged */
|
||||
|
||||
u_char *buf; /* receive buffer */
|
||||
size_t buflen; /* buffer length */
|
||||
|
Loading…
Reference in New Issue
Block a user