[evolution-data-server] Correct how extra compiler warnings are used in the maintainer mode
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Correct how extra compiler warnings are used in the maintainer mode
- Date: Wed, 14 Nov 2018 11:50:24 +0000 (UTC)
commit 2178b205aeb10249822aad7ae8f830ab8d8d4e7b
Author: Milan Crha <mcrha redhat com>
Date: Wed Nov 14 12:49:55 2018 +0100
Correct how extra compiler warnings are used in the maintainer mode
...and address the newly shown warnings as well.
cmake/modules/SetupBuildFlags.cmake | 11 ++++++-----
src/addressbook/libebook-contacts/CMakeLists.txt | 2 --
src/addressbook/libedata-book/e-book-cache.c | 1 +
src/addressbook/libedata-book/e-book-sqlite.c | 1 +
src/camel/camel-filter-driver.c | 1 +
src/camel/camel-gpg-context.c | 1 +
src/camel/camel-mime-filter-tohtml.c | 4 ++--
src/camel/camel-mime-parser.c | 1 +
src/camel/camel-mime-part.c | 1 +
src/camel/camel-store-summary.c | 2 +-
src/camel/providers/imapx/camel-imapx-utils.c | 2 ++
src/camel/tests/lib/camel-test.c | 2 +-
src/libedataserver/e-data-server-util.c | 3 ++-
13 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/cmake/modules/SetupBuildFlags.cmake b/cmake/modules/SetupBuildFlags.cmake
index 10b12bd0c..4c6154129 100644
--- a/cmake/modules/SetupBuildFlags.cmake
+++ b/cmake/modules/SetupBuildFlags.cmake
@@ -20,22 +20,23 @@ macro(setup_build_flags _maintainer_mode)
-Wredundant-decls
-Wundef
-Wwrite-strings
+ -Wno-cast-function-type
-no-undefined
-fno-strict-aliasing
)
- if(_maintainer_mode)
+ if(${_maintainer_mode})
list(APPEND proposed_flags
-Wall
-Wextra
-Wdeprecated-declarations
-Wmissing-include-dirs
)
- else(_maintainer_mode)
+ else(${_maintainer_mode})
list(APPEND proposed_flags
-Wno-deprecated-declarations
-Wno-missing-include-dir)
- endif(_maintainer_mode)
+ endif(${_maintainer_mode})
list(APPEND proposed_c_flags
${proposed_flags}
@@ -62,7 +63,7 @@ macro(setup_build_flags _maintainer_mode)
foreach(flag IN LISTS proposed_c_flags)
check_c_compiler_flag(${flag} c_flag_${flag}_supported)
if(c_flag_${flag}_supported)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+ set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
endif(c_flag_${flag}_supported)
unset(c_flag_${flag}_supported)
endforeach()
@@ -71,7 +72,7 @@ macro(setup_build_flags _maintainer_mode)
foreach(flag IN LISTS proposed_cxx_flags)
check_cxx_compiler_flag(${flag} cxx_flag_${flag}_supported)
if(cxx_flag_${flag}_supported)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+ set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
endif(cxx_flag_${flag}_supported)
unset(cxx_flag_${flag}_supported)
endforeach()
diff --git a/src/addressbook/libebook-contacts/CMakeLists.txt
b/src/addressbook/libebook-contacts/CMakeLists.txt
index bfda75f41..e9e325973 100644
--- a/src/addressbook/libebook-contacts/CMakeLists.txt
+++ b/src/addressbook/libebook-contacts/CMakeLists.txt
@@ -128,12 +128,10 @@ target_include_directories(ebook-contacts PUBLIC
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/src
${CMAKE_BINARY_DIR}/src/addressbook
- ${CMAKE_BINARY_DIR}/src/addressbook/libegdbus
${CMAKE_BINARY_DIR}/src/private
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/private
${CMAKE_SOURCE_DIR}/src/addressbook
- ${CMAKE_SOURCE_DIR}/src/addressbook/libegdbus
${CMAKE_CURRENT_BINARY_DIR}
${ADDRESSBOOK_INCLUDE_DIRS}
)
diff --git a/src/addressbook/libedata-book/e-book-cache.c b/src/addressbook/libedata-book/e-book-cache.c
index 515d990a1..45a8cad07 100644
--- a/src/addressbook/libedata-book/e-book-cache.c
+++ b/src/addressbook/libedata-book/e-book-cache.c
@@ -2198,6 +2198,7 @@ query_preflight_check (PreflightContext *context,
ii, FALSE,
check_different_fields_cb,
&data);
+ /* falls through */
case BOOK_QUERY_SUB_AND:
sub_query_context_push (ctx, elements[ii]->query, data.condition);
break;
diff --git a/src/addressbook/libedata-book/e-book-sqlite.c b/src/addressbook/libedata-book/e-book-sqlite.c
index e43da968e..06788cd77 100644
--- a/src/addressbook/libedata-book/e-book-sqlite.c
+++ b/src/addressbook/libedata-book/e-book-sqlite.c
@@ -4680,6 +4680,7 @@ query_preflight_check (PreflightContext *context,
i, FALSE,
check_different_fields_cb,
&data);
+ /* falls through */
case BOOK_QUERY_SUB_AND:
sub_query_context_push (ctx, elements[i]->query, data.condition);
break;
diff --git a/src/camel/camel-filter-driver.c b/src/camel/camel-filter-driver.c
index b6a1b2b41..423ae8525 100644
--- a/src/camel/camel-filter-driver.c
+++ b/src/camel/camel-filter-driver.c
@@ -2070,6 +2070,7 @@ filter_driver_filter_message_internal (CamelFilterDriver *driver,
goto error;
}
camel_sexp_result_free (driver->priv->eval, r);
+ break;
case CAMEL_SEARCH_NOMATCH:
camel_filter_driver_log (driver, FILTER_LOG_INFO, " Filter '%s' did not match\n",
rule->name);
break;
diff --git a/src/camel/camel-gpg-context.c b/src/camel/camel-gpg-context.c
index 4077df3d5..0b884a583 100644
--- a/src/camel/camel-gpg-context.c
+++ b/src/camel/camel-gpg-context.c
@@ -1286,6 +1286,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg,
}
/* let if fall through to verify possible signatures too */
/* break; */
+ /* falls through */
case GPG_CTX_MODE_VERIFY:
if (!strncmp ((gchar *) status, "TRUST_", 6)) {
status += 6;
diff --git a/src/camel/camel-mime-filter-tohtml.c b/src/camel/camel-mime-filter-tohtml.c
index df6283655..b9fdfd12a 100644
--- a/src/camel/camel-mime-filter-tohtml.c
+++ b/src/camel/camel-mime-filter-tohtml.c
@@ -213,7 +213,7 @@ writeln (CamelMimeFilter *mime_filter,
} while (priv->column % 8);
break;
}
- /* otherwise, FALL THROUGH */
+ /* falls through */
case ' ':
if (priv->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
&& ((inptr == (in + 1) || (inptr < inend && (*inptr == ' ' || *inptr == '\t')))))
{
@@ -221,7 +221,7 @@ writeln (CamelMimeFilter *mime_filter,
priv->column++;
break;
}
- /* otherwise, FALL THROUGH */
+ /* falls through */
default:
if (u == '\r' && inptr >= inend) {
/* This constructs \r\n sequence at the end of the line, thus pass it in
diff --git a/src/camel/camel-mime-parser.c b/src/camel/camel-mime-parser.c
index 8f8ca2943..d78aa1a22 100644
--- a/src/camel/camel-mime-parser.c
+++ b/src/camel/camel-mime-parser.c
@@ -1808,6 +1808,7 @@ tail_recurse:
case CAMEL_MIME_PARSER_STATE_HEADER:
s->state = CAMEL_MIME_PARSER_STATE_BODY;
/* coverity[fallthrough] */
+ /* falls through */
case CAMEL_MIME_PARSER_STATE_BODY:
h = s->parts;
diff --git a/src/camel/camel-mime-part.c b/src/camel/camel-mime-part.c
index 16814b896..ad40c8a83 100644
--- a/src/camel/camel-mime-part.c
+++ b/src/camel/camel-mime-part.c
@@ -967,6 +967,7 @@ mime_part_construct_from_parser_sync (CamelMimePart *mime_part,
/* set the default type of a message always */
camel_data_wrapper_take_mime_type_field (dw, camel_content_type_decode ("message/rfc822"));
/* coverity[fallthrough] */
+ /* falls through */
case CAMEL_MIME_PARSER_STATE_HEADER:
case CAMEL_MIME_PARSER_STATE_MULTIPART:
diff --git a/src/camel/camel-store-summary.c b/src/camel/camel-store-summary.c
index b78e068c7..e4e835ec8 100644
--- a/src/camel/camel-store-summary.c
+++ b/src/camel/camel-store-summary.c
@@ -790,7 +790,7 @@ camel_store_summary_info_new (CamelStoreSummary *summary)
g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL);
class = CAMEL_STORE_SUMMARY_GET_CLASS (summary);
- g_return_val_if_fail (class > 0, NULL);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->store_info_size > 0, NULL);
info = g_slice_alloc0 (class->store_info_size);
diff --git a/src/camel/providers/imapx/camel-imapx-utils.c b/src/camel/providers/imapx/camel-imapx-utils.c
index 5dc1aee11..127ff0b76 100644
--- a/src/camel/providers/imapx/camel-imapx-utils.c
+++ b/src/camel/providers/imapx/camel-imapx-utils.c
@@ -548,6 +548,7 @@ imapx_parse_capability (CamelIMAPXInputStream *stream,
token = (guchar *) g_strconcat ((gchar *) token, "+", NULL);
free_token = TRUE;
/* coverity[fallthrough] */
+ /* falls through */
case IMAPX_TOK_TOKEN:
case IMAPX_TOK_STRING:
p = token;
@@ -560,6 +561,7 @@ imapx_parse_capability (CamelIMAPXInputStream *stream,
GINT_TO_POINTER (1));
break;
}
+ /* falls through */
case IMAPX_TOK_INT:
cinfo->capa |= imapx_lookup_capability ((gchar *) token);
if (free_token) {
diff --git a/src/camel/tests/lib/camel-test.c b/src/camel/tests/lib/camel-test.c
index 9fdc6e4ea..22d370525 100644
--- a/src/camel/tests/lib/camel-test.c
+++ b/src/camel/tests/lib/camel-test.c
@@ -345,7 +345,7 @@ gint string_equal (const gchar *a, const gchar *b)
bp++;
if (ap - a != bp - a
- && ap - 1 > 0
+ && ap - a > 0
&& memcmp (a, b, ap - a) != 0) {
return 0;
}
diff --git a/src/libedataserver/e-data-server-util.c b/src/libedataserver/e-data-server-util.c
index 951a28977..47fd4d2ec 100644
--- a/src/libedataserver/e-data-server-util.c
+++ b/src/libedataserver/e-data-server-util.c
@@ -370,8 +370,9 @@ stripped_char (gunichar ch)
/* Ignore those */
return 0;
default:
- /* Convert to lowercase, fall through */
+ /* Convert to lowercase */
ch = g_unichar_tolower (ch);
+ /* falls through */
case G_UNICODE_LOWERCASE_LETTER:
if ((dlen = g_unichar_fully_decompose (ch, FALSE, decomp, 4))) {
retval = decomp[0];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]