build: merge branch 'th/build-gcc7-warnings'

(cherry picked from commit 77140cafe3)
This commit is contained in:
Thomas Haller 2017-02-06 17:41:29 +01:00
commit afa249e277
15 changed files with 47 additions and 31 deletions

View file

@ -1070,7 +1070,7 @@ nm_utils_security_valid (NMUtilsSecurityType type,
case NMU_SEC_LEAP: /* require PRIVACY bit for LEAP? */ case NMU_SEC_LEAP: /* require PRIVACY bit for LEAP? */
if (adhoc) if (adhoc)
return FALSE; return FALSE;
/* Fall through */ /* fall through */
case NMU_SEC_STATIC_WEP: case NMU_SEC_STATIC_WEP:
g_assert (have_ap); g_assert (have_ap);
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY)) if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))

View file

@ -697,7 +697,7 @@ nm_utils_security_valid (NMUtilsSecurityType type,
case NMU_SEC_LEAP: /* require PRIVACY bit for LEAP? */ case NMU_SEC_LEAP: /* require PRIVACY bit for LEAP? */
if (adhoc) if (adhoc)
return FALSE; return FALSE;
/* Fall through */ /* fall through */
case NMU_SEC_STATIC_WEP: case NMU_SEC_STATIC_WEP:
g_assert (have_ap); g_assert (have_ap);
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY)) if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))

View file

@ -217,7 +217,7 @@ nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, GError **err)
break; break;
case NM_VPN_SERVICE_STATE_STARTING: case NM_VPN_SERVICE_STATE_STARTING:
_emit_failure (plugin, NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED); _emit_failure (plugin, NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED);
/* fallthru */ /* fall through */
case NM_VPN_SERVICE_STATE_STARTED: case NM_VPN_SERVICE_STATE_STARTED:
nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPING); nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPING);
ret = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->disconnect (plugin, err); ret = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->disconnect (plugin, err);

View file

@ -61,16 +61,29 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror" CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"
fi fi
for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \ for option in \
-Wdeclaration-after-statement -Wformat-security \ -Wimplicit-fallthrough \
-Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \ -Wshadow \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wdeclaration-after-statement \
-Wformat-security \
-Wfloat-equal \
-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-duplicate-decl-specifier \ -Wno-duplicate-decl-specifier \
-Wstrict-prototypes \ -Wstrict-prototypes \
-Wno-unused-but-set-variable \ -Wno-unused-but-set-variable \
-Wno-format-y2k \ -Wno-format-y2k \
-Wundef -Wimplicit-function-declaration \ -Wundef \
-Wpointer-arith -Winit-self -Wformat-nonliteral \ -Wimplicit-function-declaration \
-Wmissing-include-dirs -Wno-pragmas; do -Wpointer-arith \
-Winit-self \
-Wformat-nonliteral \
-Wmissing-include-dirs \
-Wno-pragmas \
-Wno-format-truncation \
; do
dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning) dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
_NM_COMPILER_FLAG([$(printf '%s' "$option" | sed 's/^-Wno-/-W/')], [], _NM_COMPILER_FLAG([$(printf '%s' "$option" | sed 's/^-Wno-/-W/')], [],
[CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS $option"], []) [CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS $option"], [])

View file

@ -1171,7 +1171,7 @@ dcb_state (NMDevice *device, gboolean timeout)
break; break;
} }
_LOGD (LOGD_DCB, "dcb_state() preconfig down falling through"); _LOGD (LOGD_DCB, "dcb_state() preconfig down falling through");
/* carrier never went down? fall through */ /* fall through */
case DCB_WAIT_CARRIER_PRECONFIG_UP: case DCB_WAIT_CARRIER_PRECONFIG_UP:
if (timeout || carrier) { if (timeout || carrier) {
_LOGD (LOGD_DCB, "dcb_state() preconfig up configuring DCB"); _LOGD (LOGD_DCB, "dcb_state() preconfig up configuring DCB");
@ -1195,7 +1195,7 @@ dcb_state (NMDevice *device, gboolean timeout)
break; break;
} }
_LOGD (LOGD_DCB, "dcb_state() postconfig down falling through"); _LOGD (LOGD_DCB, "dcb_state() postconfig down falling through");
/* carrier never went down? fall through */ /* fall through */
case DCB_WAIT_CARRIER_POSTCONFIG_UP: case DCB_WAIT_CARRIER_POSTCONFIG_UP:
if (timeout || carrier) { if (timeout || carrier) {
_LOGD (LOGD_DCB, "dcb_state() postconfig up starting IP"); _LOGD (LOGD_DCB, "dcb_state() postconfig up starting IP");

View file

@ -5340,7 +5340,7 @@ dhcp4_state_changed (NMDhcpClient *client,
/* Ignore expiry before we even have a lease (NAK, old lease, etc) */ /* Ignore expiry before we even have a lease (NAK, old lease, etc) */
if (priv->ip4_state == IP_CONF) if (priv->ip4_state == IP_CONF)
break; break;
/* Fall through */ /* fall through */
case NM_DHCP_STATE_DONE: case NM_DHCP_STATE_DONE:
case NM_DHCP_STATE_FAIL: case NM_DHCP_STATE_FAIL:
dhcp4_fail (self, FALSE); dhcp4_fail (self, FALSE);
@ -6159,7 +6159,7 @@ dhcp6_state_changed (NMDhcpClient *client,
*/ */
if (priv->dhcp6.mode == NM_NDISC_DHCP_LEVEL_OTHERCONF) if (priv->dhcp6.mode == NM_NDISC_DHCP_LEVEL_OTHERCONF)
break; break;
/* Otherwise, fall through */ /* fall through */
case NM_DHCP_STATE_FAIL: case NM_DHCP_STATE_FAIL:
dhcp6_fail (self, FALSE); dhcp6_fail (self, FALSE);
break; break;
@ -10336,7 +10336,7 @@ device_ipx_changed (NMPlatform *platform,
priv->dad6_failed_addrs = g_slist_append (priv->dad6_failed_addrs, priv->dad6_failed_addrs = g_slist_append (priv->dad6_failed_addrs,
g_memdup (addr, sizeof (NMPlatformIP6Address))); g_memdup (addr, sizeof (NMPlatformIP6Address)));
} }
/* fallthrough */ /* fall through */
case NMP_OBJECT_TYPE_IP6_ROUTE: case NMP_OBJECT_TYPE_IP6_ROUTE:
if (nm_device_get_unmanaged_flags (self, NM_UNMANAGED_PLATFORM_INIT)) { if (nm_device_get_unmanaged_flags (self, NM_UNMANAGED_PLATFORM_INIT)) {
priv->queued_ip6_config_pending = TRUE; priv->queued_ip6_config_pending = TRUE;

View file

@ -489,7 +489,6 @@ connect_context_step (NMModemBroadband *self)
} }
ctx->step++; ctx->step++;
/* fall through */ /* fall through */
case CONNECT_STEP_WAIT_FOR_READY: { case CONNECT_STEP_WAIT_FOR_READY: {
GError *error = NULL; GError *error = NULL;
@ -527,9 +526,8 @@ connect_context_step (NMModemBroadband *self)
} }
ctx->step++; ctx->step++;
/* fall through */
} }
/* fall through */
case CONNECT_STEP_CONNECT: case CONNECT_STEP_CONNECT:
if (ctx->ip_types_i < ctx->ip_types->len) { if (ctx->ip_types_i < ctx->ip_types->len) {
NMModemIPType current; NMModemIPType current;

View file

@ -1127,8 +1127,7 @@ deactivate_step (DeactivateContext *ctx)
switch (ctx->step) { switch (ctx->step) {
case DEACTIVATE_CONTEXT_STEP_FIRST: case DEACTIVATE_CONTEXT_STEP_FIRST:
ctx->step++; ctx->step++;
/* Fall down */ /* fall through */
case DEACTIVATE_CONTEXT_STEP_CLEANUP: case DEACTIVATE_CONTEXT_STEP_CLEANUP:
/* Make sure we keep a ref to the PPP manager if there is one */ /* Make sure we keep a ref to the PPP manager if there is one */
if (priv->ppp_manager) if (priv->ppp_manager)
@ -1136,8 +1135,7 @@ deactivate_step (DeactivateContext *ctx)
/* Run cleanup */ /* Run cleanup */
NM_MODEM_GET_CLASS (ctx->self)->deactivate_cleanup (ctx->self, ctx->device); NM_MODEM_GET_CLASS (ctx->self)->deactivate_cleanup (ctx->self, ctx->device);
ctx->step++; ctx->step++;
/* Fall down */ /* fall through */
case DEACTIVATE_CONTEXT_STEP_PPP_MANAGER_STOP: case DEACTIVATE_CONTEXT_STEP_PPP_MANAGER_STOP:
/* If we have a PPP manager, stop it */ /* If we have a PPP manager, stop it */
if (ctx->ppp_manager) { if (ctx->ppp_manager) {
@ -1148,8 +1146,7 @@ deactivate_step (DeactivateContext *ctx)
return; return;
} }
ctx->step++; ctx->step++;
/* Fall down */ /* fall through */
case DEACTIVATE_CONTEXT_STEP_MM_DISCONNECT: case DEACTIVATE_CONTEXT_STEP_MM_DISCONNECT:
/* Disconnect asynchronously */ /* Disconnect asynchronously */
NM_MODEM_GET_CLASS (ctx->self)->disconnect (ctx->self, NM_MODEM_GET_CLASS (ctx->self)->disconnect (ctx->self,

View file

@ -1566,7 +1566,7 @@ _check_resconf_immutable (NMDnsManagerResolvConfManager rc_manager)
case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNKNOWN: case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNKNOWN:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_IMMUTABLE: case NM_DNS_MANAGER_RESOLV_CONF_MAN_IMMUTABLE:
nm_assert_not_reached (); nm_assert_not_reached ();
/* fall-through */ /* fall through */
case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED: case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED:
return NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED; return NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED;
default: default:
@ -1586,7 +1586,7 @@ _check_resconf_immutable (NMDnsManagerResolvConfManager rc_manager)
case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED: case NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_IMMUTABLE: case NM_DNS_MANAGER_RESOLV_CONF_MAN_IMMUTABLE:
nm_assert_not_reached (); nm_assert_not_reached ();
/* fall-through */ /* fall through */
case NM_DNS_MANAGER_RESOLV_CONF_MAN_FILE: case NM_DNS_MANAGER_RESOLV_CONF_MAN_FILE:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_RESOLVCONF: case NM_DNS_MANAGER_RESOLV_CONF_MAN_RESOLVCONF:
case NM_DNS_MANAGER_RESOLV_CONF_MAN_NETCONFIG: case NM_DNS_MANAGER_RESOLV_CONF_MAN_NETCONFIG:

View file

@ -1046,6 +1046,7 @@ _string_append_val (GString *str, const char *value)
case '#': case '#':
case ':': case ':':
g_string_append_c (str, '+'); g_string_append_c (str, '+');
/* fall through */
default: default:
g_string_append_c (str, *value); g_string_append_c (str, *value);
} }

View file

@ -129,18 +129,25 @@ void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) {
switch (left) { switch (left) {
case 7: case 7:
state->padding |= ((uint64_t) in[6]) << 48; state->padding |= ((uint64_t) in[6]) << 48;
/* fall through */
case 6: case 6:
state->padding |= ((uint64_t) in[5]) << 40; state->padding |= ((uint64_t) in[5]) << 40;
/* fall through */
case 5: case 5:
state->padding |= ((uint64_t) in[4]) << 32; state->padding |= ((uint64_t) in[4]) << 32;
/* fall through */
case 4: case 4:
state->padding |= ((uint64_t) in[3]) << 24; state->padding |= ((uint64_t) in[3]) << 24;
/* fall through */
case 3: case 3:
state->padding |= ((uint64_t) in[2]) << 16; state->padding |= ((uint64_t) in[2]) << 16;
/* fall through */
case 2: case 2:
state->padding |= ((uint64_t) in[1]) << 8; state->padding |= ((uint64_t) in[1]) << 8;
/* fall through */
case 1: case 1:
state->padding |= ((uint64_t) in[0]); state->padding |= ((uint64_t) in[0]);
/* fall through */
case 0: case 0:
break; break;
} }

View file

@ -1277,7 +1277,7 @@ bool clock_supported(clockid_t clock) {
if (!clock_boottime_supported()) if (!clock_boottime_supported())
return false; return false;
/* fall through, after checking the cached value for CLOCK_BOOTTIME. */ /* fall through */
default: default:
/* For everything else, check properly */ /* For everything else, check properly */

View file

@ -1003,7 +1003,7 @@ static int client_receive_message(
break; break;
} }
/* fall through for Soliciation Rapid Commit option check */ /* fall through */ /* for Soliciation Rapid Commit option check */
case DHCP6_STATE_REQUEST: case DHCP6_STATE_REQUEST:
case DHCP6_STATE_RENEW: case DHCP6_STATE_RENEW:
case DHCP6_STATE_REBIND: case DHCP6_STATE_REBIND:

View file

@ -1291,7 +1291,7 @@ test_nm_utils_strbuf_append (void)
nm_utils_strbuf_append_c (&t_buf, &t_len, str[0]); nm_utils_strbuf_append_c (&t_buf, &t_len, str[0]);
break; break;
} }
/* fall-through */ /* fall through */
case 1: case 1:
nm_utils_strbuf_append_str (&t_buf, &t_len, str); nm_utils_strbuf_append_str (&t_buf, &t_len, str);
break; break;
@ -1300,7 +1300,7 @@ test_nm_utils_strbuf_append (void)
nm_utils_strbuf_append (&t_buf, &t_len, "%c", str[0]); nm_utils_strbuf_append (&t_buf, &t_len, "%c", str[0]);
break; break;
} }
/* fall-through */ /* fall through */
case 3: case 3:
nm_utils_strbuf_append (&t_buf, &t_len, "%s", str); nm_utils_strbuf_append (&t_buf, &t_len, "%s", str);
break; break;

View file

@ -637,7 +637,7 @@ _set_vpn_state (NMVpnConnection *self,
/* Tear down and clean up the connection */ /* Tear down and clean up the connection */
call_plugin_disconnect (self); call_plugin_disconnect (self);
vpn_cleanup (self, parent_dev); vpn_cleanup (self, parent_dev);
/* Fall through */ /* fall through */
default: default:
priv->secrets_idx = SECRETS_REQ_SYSTEM; priv->secrets_idx = SECRETS_REQ_SYSTEM;
break; break;
@ -1514,7 +1514,7 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
switch (g_variant_n_children (v)) { switch (g_variant_n_children (v)) {
case 5: case 5:
g_variant_get_child (v, 4, "u", &route.pref_src); g_variant_get_child (v, 4, "u", &route.pref_src);
/* fallthrough */ /* fall through */
case 4: case 4:
g_variant_get_child (v, 0, "u", &route.network); g_variant_get_child (v, 0, "u", &route.network);
g_variant_get_child (v, 1, "u", &plen); g_variant_get_child (v, 1, "u", &plen);