mirror of https://github.com/moparisthebest/curl
curl-compilers: enable -Wimplicit-fallthrough=4 for GCC
This enables level 4 instead of the default level 3, which of the currently used comments only allows /* FALLTHROUGH */ to silence the warning. Closes https://github.com/curl/curl/pull/2747
This commit is contained in:
parent
60776a0515
commit
15ed9f87e3
|
@ -302,7 +302,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||||
* Set the contents property.
|
* Set the contents property.
|
||||||
*/
|
*/
|
||||||
case CURLFORM_PTRCONTENTS:
|
case CURLFORM_PTRCONTENTS:
|
||||||
current_form->flags |= HTTPPOST_PTRCONTENTS; /* fall through */
|
current_form->flags |= HTTPPOST_PTRCONTENTS;
|
||||||
|
/* FALLTHROUGH */
|
||||||
case CURLFORM_COPYCONTENTS:
|
case CURLFORM_COPYCONTENTS:
|
||||||
if(current_form->value)
|
if(current_form->value)
|
||||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||||
|
|
|
@ -228,7 +228,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy)
|
||||||
/* connection is already authenticated,
|
/* connection is already authenticated,
|
||||||
* don't send a header in future requests */
|
* don't send a header in future requests */
|
||||||
ntlm->state = NTLMSTATE_LAST;
|
ntlm->state = NTLMSTATE_LAST;
|
||||||
/* fall-through */
|
/* FALLTHROUGH */
|
||||||
case NTLMSTATE_LAST:
|
case NTLMSTATE_LAST:
|
||||||
Curl_safefree(*allocuserpwd);
|
Curl_safefree(*allocuserpwd);
|
||||||
authp->done = TRUE;
|
authp->done = TRUE;
|
||||||
|
|
|
@ -659,7 +659,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||||
libssh2_session_set_blocking(sshc->ssh_session, 0);
|
libssh2_session_set_blocking(sshc->ssh_session, 0);
|
||||||
|
|
||||||
state(conn, SSH_S_STARTUP);
|
state(conn, SSH_S_STARTUP);
|
||||||
/* fall-through */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
case SSH_S_STARTUP:
|
case SSH_S_STARTUP:
|
||||||
rc = libssh2_session_startup(sshc->ssh_session, (int)sock);
|
rc = libssh2_session_startup(sshc->ssh_session, (int)sock);
|
||||||
|
@ -675,7 +675,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||||
|
|
||||||
state(conn, SSH_HOSTKEY);
|
state(conn, SSH_HOSTKEY);
|
||||||
|
|
||||||
/* fall-through */
|
/* FALLTHROUGH */
|
||||||
case SSH_HOSTKEY:
|
case SSH_HOSTKEY:
|
||||||
/*
|
/*
|
||||||
* Before we authenticate we should check the hostkey's fingerprint
|
* Before we authenticate we should check the hostkey's fingerprint
|
||||||
|
|
|
@ -1606,7 +1606,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done)
|
||||||
case 0: /* timeout */
|
case 0: /* timeout */
|
||||||
pfd[0].revents = 0;
|
pfd[0].revents = 0;
|
||||||
pfd[1].revents = 0;
|
pfd[1].revents = 0;
|
||||||
/* fall through */
|
/* FALLTHROUGH */
|
||||||
default: /* read! */
|
default: /* read! */
|
||||||
if(pfd[0].revents & POLLIN) {
|
if(pfd[0].revents & POLLIN) {
|
||||||
/* read data from network */
|
/* read data from network */
|
||||||
|
|
|
@ -1519,7 +1519,7 @@ static size_t strlen_url(const char *url, bool relative)
|
||||||
switch(*ptr) {
|
switch(*ptr) {
|
||||||
case '?':
|
case '?':
|
||||||
left = FALSE;
|
left = FALSE;
|
||||||
/* fall through */
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
if(urlchar_needs_escaping(*ptr))
|
if(urlchar_needs_escaping(*ptr))
|
||||||
newlen += 2;
|
newlen += 2;
|
||||||
|
@ -1564,7 +1564,7 @@ static void strcpy_url(char *output, const char *url, bool relative)
|
||||||
switch(*iptr) {
|
switch(*iptr) {
|
||||||
case '?':
|
case '?':
|
||||||
left = FALSE;
|
left = FALSE;
|
||||||
/* fall through */
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
if(urlchar_needs_escaping(*iptr)) {
|
if(urlchar_needs_escaping(*iptr)) {
|
||||||
snprintf(optr, 4, "%%%02x", *iptr);
|
snprintf(optr, 4, "%%%02x", *iptr);
|
||||||
|
|
|
@ -1060,6 +1060,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Walloc-zero"
|
tmp_CFLAGS="$tmp_CFLAGS -Walloc-zero"
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wformat-overflow=2"
|
tmp_CFLAGS="$tmp_CFLAGS -Wformat-overflow=2"
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wformat-truncation=2"
|
tmp_CFLAGS="$tmp_CFLAGS -Wformat-truncation=2"
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough=4"
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1834,7 +1834,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||||
config->default_node_flags = toggle?GETOUT_USEREMOTE:0;
|
config->default_node_flags = toggle?GETOUT_USEREMOTE:0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall-through! */
|
/* FALLTHROUGH */
|
||||||
case 'o': /* --output */
|
case 'o': /* --output */
|
||||||
/* output file */
|
/* output file */
|
||||||
{
|
{
|
||||||
|
|
|
@ -114,7 +114,7 @@ static CURLcode glob_set(URLGlob *glob, char **patternp,
|
||||||
if(multiply(amount, pat->content.Set.size + 1))
|
if(multiply(amount, pat->content.Set.size + 1))
|
||||||
return GLOBERROR("range overflow", 0, CURLE_URL_MALFORMAT);
|
return GLOBERROR("range overflow", 0, CURLE_URL_MALFORMAT);
|
||||||
|
|
||||||
/* fall-through */
|
/* FALLTHROUGH */
|
||||||
case ',':
|
case ',':
|
||||||
|
|
||||||
*buf = '\0';
|
*buf = '\0';
|
||||||
|
@ -157,7 +157,7 @@ static CURLcode glob_set(URLGlob *glob, char **patternp,
|
||||||
++pattern;
|
++pattern;
|
||||||
++(*posp);
|
++(*posp);
|
||||||
}
|
}
|
||||||
/* intentional fallthrough */
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
*buf++ = *pattern++; /* copy character to set element */
|
*buf++ = *pattern++; /* copy character to set element */
|
||||||
++(*posp);
|
++(*posp);
|
||||||
|
|
Loading…
Reference in New Issue