all: avoid bogus compiler warning about uninitialized variable
With LTO and optimizations, gcc issues several bogus "maybe-uninitialized" warnings. Work-around them by initializing the variables.
This commit is contained in:

committed by
Beniamino Galvani

parent
14957e914a
commit
c77871e5e9
@@ -674,8 +674,10 @@ _nm_connection_find_base_type_setting (NMConnection *connection)
|
|||||||
{
|
{
|
||||||
NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (connection);
|
NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (connection);
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
NMSetting *setting = NULL, *s_iter;
|
NMSetting *setting = NULL;
|
||||||
NMSettingPriority setting_prio, s_iter_prio;
|
NMSetting *s_iter;
|
||||||
|
NMSettingPriority setting_prio = NM_SETTING_PRIORITY_USER;
|
||||||
|
NMSettingPriority s_iter_prio;
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, priv->settings);
|
g_hash_table_iter_init (&iter, priv->settings);
|
||||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &s_iter)) {
|
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &s_iter)) {
|
||||||
|
@@ -919,7 +919,7 @@ vfs_to_dbus (NMSetting *setting, const char *property)
|
|||||||
GVariantBuilder vf_builder;
|
GVariantBuilder vf_builder;
|
||||||
const guint *vlan_ids;
|
const guint *vlan_ids;
|
||||||
const char **name;
|
const char **name;
|
||||||
guint num_vlans;
|
guint num_vlans = 0;
|
||||||
|
|
||||||
g_variant_builder_init (&vf_builder, G_VARIANT_TYPE_VARDICT);
|
g_variant_builder_init (&vf_builder, G_VARIANT_TYPE_VARDICT);
|
||||||
g_variant_builder_add (&vf_builder, "{sv}", "index",
|
g_variant_builder_add (&vf_builder, "{sv}", "index",
|
||||||
|
@@ -890,7 +890,8 @@ void internal_hashmap_clear(HashmapBase *h, free_func_t default_free_key, free_f
|
|||||||
* themselves from our hash table a second time, the entry is already gone. */
|
* themselves from our hash table a second time, the entry is already gone. */
|
||||||
|
|
||||||
while (internal_hashmap_size(h) > 0) {
|
while (internal_hashmap_size(h) > 0) {
|
||||||
void *v, *k;
|
void *k = NULL;
|
||||||
|
void *v;
|
||||||
|
|
||||||
v = internal_hashmap_first_key_and_value(h, true, &k);
|
v = internal_hashmap_first_key_and_value(h, true, &k);
|
||||||
|
|
||||||
|
@@ -5643,7 +5643,6 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
|
|||||||
NMDeviceClass *klass;
|
NMDeviceClass *klass;
|
||||||
const char *const *patterns;
|
const char *const *patterns;
|
||||||
NMSettingMatch *s_match;
|
NMSettingMatch *s_match;
|
||||||
guint num_patterns;
|
|
||||||
|
|
||||||
klass = NM_DEVICE_GET_CLASS (self);
|
klass = NM_DEVICE_GET_CLASS (self);
|
||||||
if (klass->connection_type_check_compatible) {
|
if (klass->connection_type_check_compatible) {
|
||||||
@@ -5684,6 +5683,8 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
|
|||||||
s_match = (NMSettingMatch *) nm_connection_get_setting (connection,
|
s_match = (NMSettingMatch *) nm_connection_get_setting (connection,
|
||||||
NM_TYPE_SETTING_MATCH);
|
NM_TYPE_SETTING_MATCH);
|
||||||
if (s_match) {
|
if (s_match) {
|
||||||
|
guint num_patterns = 0;
|
||||||
|
|
||||||
patterns = nm_setting_match_get_interface_names (s_match, &num_patterns);
|
patterns = nm_setting_match_get_interface_names (s_match, &num_patterns);
|
||||||
if (!nm_wildcard_match_check (device_iface, patterns, num_patterns)) {
|
if (!nm_wildcard_match_check (device_iface, patterns, num_patterns)) {
|
||||||
nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
|
nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
|
||||||
|
@@ -2153,7 +2153,7 @@ nm_ip4_config_get_first_address (const NMIP4Config *self)
|
|||||||
const NMPlatformIP4Address *
|
const NMPlatformIP4Address *
|
||||||
_nmtst_ip4_config_get_address (const NMIP4Config *self, guint i)
|
_nmtst_ip4_config_get_address (const NMIP4Config *self, guint i)
|
||||||
{
|
{
|
||||||
NMDedupMultiIter iter;
|
NMDedupMultiIter iter = { };
|
||||||
const NMPlatformIP4Address *a = NULL;
|
const NMPlatformIP4Address *a = NULL;
|
||||||
guint j;
|
guint j;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user