]> granicus.if.org Git - curl/commitdiff
build: fix gcc7 implicit fallthrough warnings
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Tue, 28 Feb 2017 21:45:28 +0000 (22:45 +0100)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 3 Mar 2017 08:09:46 +0000 (03:09 -0500)
Mark intended fallthroughs with /* FALLTHROUGH */ so that gcc will know
it's expected and won't warn on [-Wimplicit-fallthrough=].

Closes https://github.com/curl/curl/pull/1297

lib/formdata.c
lib/ftp.c
lib/vtls/openssl.c
src/tool_cb_dbg.c

index c214ba28e90eddd337dab77b26c3ab746e3a6ca3..3626f562f9ba5437b9df6ad6bf82dcb49f17c736 100644 (file)
@@ -342,6 +342,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
 #else
       current_form->flags |= HTTPPOST_PTRNAME; /* fall through */
 #endif
+      /* FALLTHROUGH */
     case CURLFORM_COPYNAME:
       if(current_form->name)
         return_value = CURL_FORMADD_OPTION_TWICE;
index 867c97994d612655d6c29b3746beb1ba6c81f662..a1546a135c24b6d5872fd4d14fc598e8c74efda9 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3214,6 +3214,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
 
     /* until we cope better with prematurely ended requests, let them
      * fallback as if in complete failure */
+    /* FALLTHROUGH */
   default:       /* by default, an error means the control connection is
                     wedged and should not be used anymore */
     ftpc->ctl_valid = FALSE;
index eb625fe93d38caa894ddff429f45689bfc2b09d2..20626fec9e914cea6676ce6caf8f8fd5927cb842 100644 (file)
@@ -539,6 +539,7 @@ int cert_stuff(struct connectdata *conn,
       if(!key_file)
         /* cert & key can only be in PEM case in the same file */
         key_file=cert_file;
+      /* FALLTHROUGH */
     case SSL_FILETYPE_ASN1:
       if(SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type) != 1) {
         failf(data, "unable to set private key file: '%s' type %s",
index 8e81f1be32bfe8a8cd1858b137f3e9bda168e35c..f4252ad8827f94f559ab61ff31c4629d672cb918 100644 (file)
@@ -185,6 +185,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
   switch(type) {
   case CURLINFO_TEXT:
     fprintf(output, "%s== Info: %s", timebuf, data);
+    /* FALLTHROUGH */
   default: /* in case a new one is introduced to shock us */
     return 0;