mirror of
https://github.com/systemd/systemd.git
synced 2026-08-10 17:14:31 +00:00
network: silence false warning about unitialized variable
[1177/3647] Compiling C object systemd-networkd.p/src_network_networkd-bridge-vlan.c.o
In function ‘bridge_vlan_append_set_info’,
inlined from ‘bridge_vlan_set_message’ at ../src/network/networkd-bridge-vlan.c:257:21:
../src/network/networkd-bridge-vlan.c:162:28: warning: ‘untagged’ may be used uninitialized [-Wmaybe-uninitialized]
162 | if (untagged == u)
| ^
../src/network/networkd-bridge-vlan.c: In function ‘bridge_vlan_set_message’:
../src/network/networkd-bridge-vlan.c:111:14: note: ‘untagged’ was declared here
111 | bool untagged, pvid_is_untagged;
| ^~~~~~~~
This commit is contained in:
@@ -108,7 +108,8 @@ static uint16_t link_get_pvid(Link *link, bool *ret_untagged) {
|
||||
static int bridge_vlan_append_set_info(Link *link, sd_netlink_message *m) {
|
||||
_cleanup_free_ char *str = NULL;
|
||||
uint16_t pvid, begin = UINT16_MAX;
|
||||
bool untagged, pvid_is_untagged;
|
||||
bool pvid_is_untagged, untagged = false; /* <untagged> is always set togather with <begin>.
|
||||
* Initialize to appease gcc. */
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
|
||||
Reference in New Issue
Block a user