diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c
index 410938a2927379eff3e3d50df4b0381be913003a..6485c97bb04e454d175b30bbb6adc7d3d451cdf2 100644
--- a/lib/curl_fnmatch.c
+++ b/lib/curl_fnmatch.c
@@ -280,7 +280,10 @@ static int setcharset(unsigned char **p, unsigned char *charset)
         state = CURLFNM_SCHS_DEFAULT;
       }
       else
-        return SETCHARSET_FAIL;
+        /* used 'goto fail' instead of 'return SETCHARSET_FAIL' to avoid a
+         * nonsense warning 'statement not reached' at end of the fnc when
+         * compiling on Solaris */
+        goto fail;
       break;
     case CURLFNM_SCHS_RIGHTBRLEFTBR:
       if(c == ']') {
@@ -294,6 +297,7 @@ static int setcharset(unsigned char **p, unsigned char *charset)
       break;
     }
   }
+fail:
   return SETCHARSET_FAIL;
 }
 
diff --git a/lib/ftp.c b/lib/ftp.c
index afd15b4d148d1ef9e89a2d152b7633cbb908a797..7e8f58574e4a3d65fc86d593c723389537b2aa6a 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3628,10 +3628,8 @@ static CURLcode wc_statemach(struct connectdata *conn)
               finfo->filename);
         wildcard->state = CURLWC_SKIP;
         return wc_statemach(conn);
-        break;
       case CURL_CHUNK_BGN_FUNC_FAIL:
         return CURLE_CHUNK_FAILED;
-        break;
       }
     }
 
diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c
index 4e10c4331c7909af0d976efc3da5d86279d6bddb..947b71417c4799eea158e87fe41e6de5c66b2d21 100644
--- a/lib/ftplistparser.c
+++ b/lib/ftplistparser.c
@@ -452,7 +452,6 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
         default:
           PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
           return bufflen;
-          break;
         }
         parser->state.UNIX.main = PL_UNIX_PERMISSION;
         parser->item_length = 0;
@@ -993,7 +992,6 @@ size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr)
       break;
     default:
       return bufflen+1;
-      break;
     }
 
     i++;