summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-21 20:34:34 +0100
committerThomas Haller <thaller@redhat.com>2020-02-21 20:34:34 +0100
commitcb2c00d823c1c75bc1b3c019df84b1db1e03386b (patch)
tree4697cc766ffa9a8947d0f0f09db8ea14b2c84102
parentb4e48b5ce54f62d8d884899c736c833b047081ba (diff)
parentc437d6c60a1d2b051c6e8b4c5a236ea0d11522ba (diff)
downloadNetworkManager-cb2c00d823c1c75bc1b3c019df84b1db1e03386b.tar.gz
all: merge branch 'th/fix-gitlab-ci-failures'
-rw-r--r--.gitlab-ci.yml10
-rw-r--r--libnm-core/nm-utils.c2
-rw-r--r--libnm-core/tests/test-general.c6
-rw-r--r--libnm/meson.build1
-rw-r--r--libnm/nm-vpn-service-plugin.c2
-rw-r--r--m4/compiler_options.m421
-rw-r--r--meson.build23
-rw-r--r--src/devices/nm-device-ethernet.c4
-rw-r--r--src/devices/nm-device.c6
-rw-r--r--src/devices/wwan/nm-modem-broadband.c10
-rw-r--r--src/dns/nm-dns-manager.c4
-rw-r--r--src/nm-config.c2
-rw-r--r--src/nm-manager.c2
-rw-r--r--src/tests/test-core.c4
-rw-r--r--src/vpn/nm-vpn-connection.c4
-rwxr-xr-xtools/run-nm-test.sh18
16 files changed, 87 insertions, 32 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6394e3a377..6d46398ea5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -96,6 +96,12 @@ t_fedora:30:
<<: *fedora_install
image: fedora:30
<<: *do_build
+ when: manual
+
+t_fedora:31:
+ <<: *fedora_install
+ image: fedora:31
+ <<: *do_build
variables:
NM_BUILD_TARBALL: 1
artifacts:
@@ -105,9 +111,9 @@ t_fedora:30:
- NetworkManager-1*.tar.xz
- NetworkManager-1*.src.rpm
-t_fedora:31:
+t_fedora:32:
<<: *fedora_install
- image: fedora:31
+ image: fedora:32
<<: *do_build
when: manual
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index 8e3de874a5..c6f057e60e 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -1178,7 +1178,7 @@ nm_utils_security_valid (NMUtilsSecurityType type,
case NMU_SEC_LEAP: /* require PRIVACY bit for LEAP? */
if (adhoc)
return FALSE;
- /* fall through */
+ /* fall-through */
case NMU_SEC_STATIC_WEP:
if (!have_ap) {
if (wifi_caps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104))
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c
index 88ca93f95d..532e2c2449 100644
--- a/libnm-core/tests/test-general.c
+++ b/libnm-core/tests/test-general.c
@@ -7760,7 +7760,7 @@ test_nm_in_set (void)
_ASSERT (5, NM_IN_SET_SE (-1, G( 1), G( 2), G( 3), G(-1), G( 5)));
_ASSERT (6, NM_IN_SET_SE (-1, G( 1), G( 2), G( 3), G( 4), G( 5), G(-1)));
- (void) NM_IN_SET ("a", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16");
+ g_assert (!NM_IN_SET (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16));
#undef G
#undef N
#undef _ASSERT
@@ -7887,7 +7887,9 @@ test_nm_in_strset (void)
_ASSERT (6, NM_IN_STRSET ("a", G(NULL), G("b"), G("c"), G("d"), G("e"), G("a")));
_ASSERT (6, !NM_IN_STRSET ("a", G(NULL), G("b"), G("c"), G("d"), G("e"), G("f")));
- (void) NM_IN_STRSET ("a", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16");
+ g_assert (!NM_IN_STRSET (NULL, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"));
+ g_assert (!NM_IN_STRSET ("_", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"));
+ g_assert ( NM_IN_STRSET ("10", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"));
#undef G
#undef N
#undef _ASSERT
diff --git a/libnm/meson.build b/libnm/meson.build
index 29a21db76a..89794dc3c0 100644
--- a/libnm/meson.build
+++ b/libnm/meson.build
@@ -290,6 +290,7 @@ libnm_libnm_aux = static_library(
],
dependencies: [
libnm_core_nm_default_dep,
+ libnm_libnm_core_intern_dep,
libnm_dep,
],
)
diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c
index 9ebcfd6461..a0df8402c5 100644
--- a/libnm/nm-vpn-service-plugin.c
+++ b/libnm/nm-vpn-service-plugin.c
@@ -200,7 +200,7 @@ nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, GError **err)
break;
case NM_VPN_SERVICE_STATE_STARTING:
_emit_failure (plugin, NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED);
- /* fall through */
+ /* fall-through */
case NM_VPN_SERVICE_STATE_STARTED:
nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPING);
ret = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->disconnect (plugin, err);
diff --git a/m4/compiler_options.m4 b/m4/compiler_options.m4
index 3ceccd983f..9adc1f14c3 100644
--- a/m4/compiler_options.m4
+++ b/m4/compiler_options.m4
@@ -70,7 +70,6 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-Wfloat-equal \
-Wformat-nonliteral \
-Wformat-security \
- -Wimplicit-fallthrough \
-Wimplicit-function-declaration \
-Winit-self \
-Wlogical-op \
@@ -137,6 +136,26 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
[G_DEFINE_TYPE (NMObject, nm_object, G_TYPE_OBJECT)]
)
+ dnl clang started supporting -Wimplicit-fallthrough, but it does not
+ dnl honor the code comments to suppress the warning. Disable the
+ dnl warning with clang.
+ dnl
+ NM_COMPILER_WARNING([$1], [implicit-fallthrough],
+ [int foo(int a);
+ int foo(int a) {
+ int r = 0;
+ switch (a) {
+ case 1:
+ r++;
+ /* fall-through */
+ case 2:
+ r++;
+ break;
+ }
+ return r;
+ }]
+ )
+
eval "AS_TR_SH([$1])='$CFLAGS_MORE_WARNINGS $$1'"
else
AC_MSG_RESULT(no)
diff --git a/meson.build b/meson.build
index a5ea1d10fd..68a0c92f69 100644
--- a/meson.build
+++ b/meson.build
@@ -179,7 +179,6 @@ if nm_debug
'-Wfloat-equal',
'-Wformat-nonliteral',
'-Wformat-security',
- '-Wimplicit-fallthrough',
'-Wimplicit-function-declaration',
'-Winit-self',
'-Wlogical-op',
@@ -211,6 +210,28 @@ if nm_debug
'-Wunknown-attributes',
'-fno-strict-aliasing',
])
+
+ if cc.has_argument('-Wimplicit-fallthrough')
+ if cc.compiles('''
+ int main(int argc, char **argv) {
+ int r = 0;
+ switch (argc) {
+ case 0:
+ r++;
+ /* fall-through */
+ case 1:
+ r++;
+ break;
+ }
+ return r;
+ }
+ ''',
+ args: '-Werror=implicit-fallthrough',
+ name: '-Werror=implicit-fallthrough')
+ common_flags += '-Wimplicit-fallthrough'
+ endif
+ endif
+
endif
add_project_arguments(common_flags, language: 'c')
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c
index 3c478fa3ed..c9dd75d6af 100644
--- a/src/devices/nm-device-ethernet.c
+++ b/src/devices/nm-device-ethernet.c
@@ -1241,7 +1241,7 @@ dcb_state (NMDevice *device, gboolean timeout)
break;
}
_LOGD (LOGD_DCB, "dcb_state() preconfig down falling through");
- /* fall through */
+ /* fall-through */
case DCB_WAIT_CARRIER_PRECONFIG_UP:
if (timeout || carrier) {
_LOGD (LOGD_DCB, "dcb_state() preconfig up configuring DCB");
@@ -1265,7 +1265,7 @@ dcb_state (NMDevice *device, gboolean timeout)
break;
}
_LOGD (LOGD_DCB, "dcb_state() postconfig down falling through");
- /* fall through */
+ /* fall-through */
case DCB_WAIT_CARRIER_POSTCONFIG_UP:
if (timeout || carrier) {
_LOGD (LOGD_DCB, "dcb_state() postconfig up starting IP");
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index d9d9eea280..52054ac456 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -8097,7 +8097,7 @@ dhcp4_state_changed (NMDhcpClient *client,
/* Ignore expiry before we even have a lease (NAK, old lease, etc) */
if (priv->ip_state_4 == NM_DEVICE_IP_STATE_CONF)
break;
- /* fall through */
+ /* fall-through */
case NM_DHCP_STATE_DONE:
case NM_DHCP_STATE_FAIL:
case NM_DHCP_STATE_TERMINATED:
@@ -8864,7 +8864,7 @@ dhcp6_state_changed (NMDhcpClient *client,
*/
if (priv->dhcp6.mode == NM_NDISC_DHCP_LEVEL_OTHERCONF)
break;
- /* fall through */
+ /* fall-through */
case NM_DHCP_STATE_DONE:
case NM_DHCP_STATE_FAIL:
dhcp6_fail (self, state);
@@ -13906,7 +13906,7 @@ device_ipx_changed (NMPlatform *platform,
(gpointer) nmp_object_ref (NMP_OBJECT_UP_CAST (addr)));
}
- /* fall through */
+ /* fall-through */
case NMP_OBJECT_TYPE_IP6_ROUTE:
if (!priv->queued_ip_config_id_6) {
priv->queued_ip_config_id_6 = g_idle_add (queued_ip6_config_change, self);
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index a1ae867128..947aa4c840 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -548,7 +548,7 @@ connect_context_step (NMModemBroadband *self)
switch (ctx->step) {
case CONNECT_STEP_FIRST:
ctx->step++;
- /* fall through */
+ /* fall-through */
case CONNECT_STEP_WAIT_FOR_SIM:
if (MODEM_CAPS_3GPP (ctx->caps) && !self->_priv.sim_iface) {
@@ -556,7 +556,7 @@ connect_context_step (NMModemBroadband *self)
break;
}
ctx->step++;
- /* fall through */
+ /* fall-through */
case CONNECT_STEP_UNLOCK:
if ( MODEM_CAPS_3GPP (ctx->caps)
@@ -577,7 +577,7 @@ connect_context_step (NMModemBroadband *self)
break;
}
ctx->step++;
- /* fall through */
+ /* fall-through */
case CONNECT_STEP_WAIT_FOR_READY: {
GError *error = NULL;
@@ -605,7 +605,7 @@ connect_context_step (NMModemBroadband *self)
ctx->step++;
}
- /* fall through */
+ /* fall-through */
case CONNECT_STEP_CONNECT:
if (!ctx->connect_properties)
break;
@@ -639,7 +639,7 @@ connect_context_step (NMModemBroadband *self)
}
ctx->step++;
- /* fall through */
+ /* fall-through */
case CONNECT_STEP_LAST:
if (self->_priv.ipv4_config || self->_priv.ipv6_config)
diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c
index 6fc6c829fa..9f4b2e8a49 100644
--- a/src/dns/nm-dns-manager.c
+++ b/src/dns/nm-dns-manager.c
@@ -1805,7 +1805,7 @@ _check_resconf_immutable (NMDnsManagerResolvConfManager rc_manager)
case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNKNOWN:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_IMMUTABLE:
nm_assert_not_reached ();
- /* fall through */
+ /* fall-through */
case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED:
return NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED;
default:
@@ -1825,7 +1825,7 @@ _check_resconf_immutable (NMDnsManagerResolvConfManager rc_manager)
case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_IMMUTABLE:
nm_assert_not_reached ();
- /* fall through */
+ /* fall-through */
case NM_DNS_MANAGER_RESOLV_CONF_MAN_FILE:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_RESOLVCONF:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_NETCONFIG:
diff --git a/src/nm-config.c b/src/nm-config.c
index 198f803fab..4b4ffd3122 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -1355,7 +1355,7 @@ _string_append_val (GString *str, const char *value)
case '#':
case ':':
g_string_append_c (str, '+');
- /* fall through */
+ /* fall-through */
default:
g_string_append_c (str, *value);
}
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 75bee452de..e49c739a10 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -3335,7 +3335,7 @@ add:
_LOGI (LOGD_PLATFORM, "(%s): '%s' plugin not available; creating generic device",
plink->name, nm_link_type_to_string (plink->type));
nm_plugin_missing = TRUE;
- /* fall through */
+ /* fall-through */
default:
device = nm_device_generic_new (plink, nm_plugin_missing);
break;
diff --git a/src/tests/test-core.c b/src/tests/test-core.c
index f55f3dff05..590f7c36a5 100644
--- a/src/tests/test-core.c
+++ b/src/tests/test-core.c
@@ -1536,7 +1536,7 @@ test_nm_utils_strbuf_append (void)
_strbuf_append_c (&t_buf, &t_len, str[0]);
break;
}
- /* fall through */
+ /* fall-through */
case 1:
_strbuf_append_str (&t_buf, &t_len, str);
break;
@@ -1545,7 +1545,7 @@ test_nm_utils_strbuf_append (void)
_strbuf_append (&t_buf, &t_len, "%c", str[0]);
break;
}
- /* fall through */
+ /* fall-through */
case 3:
_strbuf_append (&t_buf, &t_len, "%s", str);
break;
diff --git a/src/vpn/nm-vpn-connection.c b/src/vpn/nm-vpn-connection.c
index f3e4a6812e..3e208a8806 100644
--- a/src/vpn/nm-vpn-connection.c
+++ b/src/vpn/nm-vpn-connection.c
@@ -619,7 +619,7 @@ _set_vpn_state (NMVpnConnection *self,
}
vpn_cleanup (self, parent_dev);
- /* fall through */
+ /* fall-through */
default:
priv->secrets_idx = SECRETS_REQ_SYSTEM;
break;
@@ -1580,7 +1580,7 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
switch (g_variant_n_children (v)) {
case 5:
g_variant_get_child (v, 4, "u", &route.pref_src);
- /* fall through */
+ /* fall-through */
case 4:
g_variant_get_child (v, 0, "u", &route.network);
g_variant_get_child (v, 1, "u", &plen);
diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh
index 140236dcb3..21f0d7c154 100755
--- a/tools/run-nm-test.sh
+++ b/tools/run-nm-test.sh
@@ -295,12 +295,18 @@ fi
if [ $HAS_ERRORS -eq 0 ]; then
# valgrind doesn't support setns syscall and spams the logfile.
# hack around it...
- if [ "$TEST_NAME" = 'test-link-linux' -o \
- "$TEST_NAME" = 'test-acd' ]; then
- if [ -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then
- HAS_ERRORS=1
- fi
- fi
+ case "$TEST_NAME" in
+ 'test-link-linux' | \
+ 'test-acd' | \
+ 'test-service-providers' | \
+ 'test-remote-settings-client' | \
+ 'test-secret-agent' | \
+ 'test-nm-client' )
+ if [ -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then
+ HAS_ERRORS=1
+ fi
+ ;;
+ esac
fi
if [ $HAS_ERRORS -eq 0 ]; then