Commit 2178b205 authored by Milan Crha's avatar Milan Crha

Correct how extra compiler warnings are used in the maintainer mode

...and address the newly shown warnings as well.
parent 5eaebbe5
...@@ -20,22 +20,23 @@ macro(setup_build_flags _maintainer_mode) ...@@ -20,22 +20,23 @@ macro(setup_build_flags _maintainer_mode)
-Wredundant-decls -Wredundant-decls
-Wundef -Wundef
-Wwrite-strings -Wwrite-strings
-Wno-cast-function-type
-no-undefined -no-undefined
-fno-strict-aliasing -fno-strict-aliasing
) )
if(_maintainer_mode) if(${_maintainer_mode})
list(APPEND proposed_flags list(APPEND proposed_flags
-Wall -Wall
-Wextra -Wextra
-Wdeprecated-declarations -Wdeprecated-declarations
-Wmissing-include-dirs -Wmissing-include-dirs
) )
else(_maintainer_mode) else(${_maintainer_mode})
list(APPEND proposed_flags list(APPEND proposed_flags
-Wno-deprecated-declarations -Wno-deprecated-declarations
-Wno-missing-include-dir) -Wno-missing-include-dir)
endif(_maintainer_mode) endif(${_maintainer_mode})
list(APPEND proposed_c_flags list(APPEND proposed_c_flags
${proposed_flags} ${proposed_flags}
...@@ -62,7 +63,7 @@ macro(setup_build_flags _maintainer_mode) ...@@ -62,7 +63,7 @@ macro(setup_build_flags _maintainer_mode)
foreach(flag IN LISTS proposed_c_flags) foreach(flag IN LISTS proposed_c_flags)
check_c_compiler_flag(${flag} c_flag_${flag}_supported) check_c_compiler_flag(${flag} c_flag_${flag}_supported)
if(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) endif(c_flag_${flag}_supported)
unset(c_flag_${flag}_supported) unset(c_flag_${flag}_supported)
endforeach() endforeach()
...@@ -71,7 +72,7 @@ macro(setup_build_flags _maintainer_mode) ...@@ -71,7 +72,7 @@ macro(setup_build_flags _maintainer_mode)
foreach(flag IN LISTS proposed_cxx_flags) foreach(flag IN LISTS proposed_cxx_flags)
check_cxx_compiler_flag(${flag} cxx_flag_${flag}_supported) check_cxx_compiler_flag(${flag} cxx_flag_${flag}_supported)
if(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) endif(cxx_flag_${flag}_supported)
unset(cxx_flag_${flag}_supported) unset(cxx_flag_${flag}_supported)
endforeach() endforeach()
......
...@@ -128,12 +128,10 @@ target_include_directories(ebook-contacts PUBLIC ...@@ -128,12 +128,10 @@ target_include_directories(ebook-contacts PUBLIC
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/src
${CMAKE_BINARY_DIR}/src/addressbook ${CMAKE_BINARY_DIR}/src/addressbook
${CMAKE_BINARY_DIR}/src/addressbook/libegdbus
${CMAKE_BINARY_DIR}/src/private ${CMAKE_BINARY_DIR}/src/private
${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/private ${CMAKE_SOURCE_DIR}/src/private
${CMAKE_SOURCE_DIR}/src/addressbook ${CMAKE_SOURCE_DIR}/src/addressbook
${CMAKE_SOURCE_DIR}/src/addressbook/libegdbus
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${ADDRESSBOOK_INCLUDE_DIRS} ${ADDRESSBOOK_INCLUDE_DIRS}
) )
......
...@@ -2198,6 +2198,7 @@ query_preflight_check (PreflightContext *context, ...@@ -2198,6 +2198,7 @@ query_preflight_check (PreflightContext *context,
ii, FALSE, ii, FALSE,
check_different_fields_cb, check_different_fields_cb,
&data); &data);
/* falls through */
case BOOK_QUERY_SUB_AND: case BOOK_QUERY_SUB_AND:
sub_query_context_push (ctx, elements[ii]->query, data.condition); sub_query_context_push (ctx, elements[ii]->query, data.condition);
break; break;
......
...@@ -4680,6 +4680,7 @@ query_preflight_check (PreflightContext *context, ...@@ -4680,6 +4680,7 @@ query_preflight_check (PreflightContext *context,
i, FALSE, i, FALSE,
check_different_fields_cb, check_different_fields_cb,
&data); &data);
/* falls through */
case BOOK_QUERY_SUB_AND: case BOOK_QUERY_SUB_AND:
sub_query_context_push (ctx, elements[i]->query, data.condition); sub_query_context_push (ctx, elements[i]->query, data.condition);
break; break;
......
...@@ -2070,6 +2070,7 @@ filter_driver_filter_message_internal (CamelFilterDriver *driver, ...@@ -2070,6 +2070,7 @@ filter_driver_filter_message_internal (CamelFilterDriver *driver,
goto error; goto error;
} }
camel_sexp_result_free (driver->priv->eval, r); camel_sexp_result_free (driver->priv->eval, r);
break;
case CAMEL_SEARCH_NOMATCH: case CAMEL_SEARCH_NOMATCH:
camel_filter_driver_log (driver, FILTER_LOG_INFO, " Filter '%s' did not match\n", rule->name); camel_filter_driver_log (driver, FILTER_LOG_INFO, " Filter '%s' did not match\n", rule->name);
break; break;
......
...@@ -1286,6 +1286,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, ...@@ -1286,6 +1286,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg,
} }
/* let if fall through to verify possible signatures too */ /* let if fall through to verify possible signatures too */
/* break; */ /* break; */
/* falls through */
case GPG_CTX_MODE_VERIFY: case GPG_CTX_MODE_VERIFY:
if (!strncmp ((gchar *) status, "TRUST_", 6)) { if (!strncmp ((gchar *) status, "TRUST_", 6)) {
status += 6; status += 6;
......
...@@ -213,7 +213,7 @@ writeln (CamelMimeFilter *mime_filter, ...@@ -213,7 +213,7 @@ writeln (CamelMimeFilter *mime_filter,
} while (priv->column % 8); } while (priv->column % 8);
break; break;
} }
/* otherwise, FALL THROUGH */ /* falls through */
case ' ': case ' ':
if (priv->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES if (priv->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES
&& ((inptr == (in + 1) || (inptr < inend && (*inptr == ' ' || *inptr == '\t'))))) { && ((inptr == (in + 1) || (inptr < inend && (*inptr == ' ' || *inptr == '\t'))))) {
...@@ -221,7 +221,7 @@ writeln (CamelMimeFilter *mime_filter, ...@@ -221,7 +221,7 @@ writeln (CamelMimeFilter *mime_filter,
priv->column++; priv->column++;
break; break;
} }
/* otherwise, FALL THROUGH */ /* falls through */
default: default:
if (u == '\r' && inptr >= inend) { if (u == '\r' && inptr >= inend) {
/* This constructs \r\n sequence at the end of the line, thus pass it in /* This constructs \r\n sequence at the end of the line, thus pass it in
......
...@@ -1808,6 +1808,7 @@ tail_recurse: ...@@ -1808,6 +1808,7 @@ tail_recurse:
case CAMEL_MIME_PARSER_STATE_HEADER: case CAMEL_MIME_PARSER_STATE_HEADER:
s->state = CAMEL_MIME_PARSER_STATE_BODY; s->state = CAMEL_MIME_PARSER_STATE_BODY;
/* coverity[fallthrough] */ /* coverity[fallthrough] */
/* falls through */
case CAMEL_MIME_PARSER_STATE_BODY: case CAMEL_MIME_PARSER_STATE_BODY:
h = s->parts; h = s->parts;
......
...@@ -967,6 +967,7 @@ mime_part_construct_from_parser_sync (CamelMimePart *mime_part, ...@@ -967,6 +967,7 @@ mime_part_construct_from_parser_sync (CamelMimePart *mime_part,
/* set the default type of a message always */ /* set the default type of a message always */
camel_data_wrapper_take_mime_type_field (dw, camel_content_type_decode ("message/rfc822")); camel_data_wrapper_take_mime_type_field (dw, camel_content_type_decode ("message/rfc822"));
/* coverity[fallthrough] */ /* coverity[fallthrough] */
/* falls through */
case CAMEL_MIME_PARSER_STATE_HEADER: case CAMEL_MIME_PARSER_STATE_HEADER:
case CAMEL_MIME_PARSER_STATE_MULTIPART: case CAMEL_MIME_PARSER_STATE_MULTIPART:
......
...@@ -790,7 +790,7 @@ camel_store_summary_info_new (CamelStoreSummary *summary) ...@@ -790,7 +790,7 @@ camel_store_summary_info_new (CamelStoreSummary *summary)
g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL); g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL);
class = CAMEL_STORE_SUMMARY_GET_CLASS (summary); 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); g_return_val_if_fail (class->store_info_size > 0, NULL);
info = g_slice_alloc0 (class->store_info_size); info = g_slice_alloc0 (class->store_info_size);
......
...@@ -548,6 +548,7 @@ imapx_parse_capability (CamelIMAPXInputStream *stream, ...@@ -548,6 +548,7 @@ imapx_parse_capability (CamelIMAPXInputStream *stream,
token = (guchar *) g_strconcat ((gchar *) token, "+", NULL); token = (guchar *) g_strconcat ((gchar *) token, "+", NULL);
free_token = TRUE; free_token = TRUE;
/* coverity[fallthrough] */ /* coverity[fallthrough] */
/* falls through */
case IMAPX_TOK_TOKEN: case IMAPX_TOK_TOKEN:
case IMAPX_TOK_STRING: case IMAPX_TOK_STRING:
p = token; p = token;
...@@ -560,6 +561,7 @@ imapx_parse_capability (CamelIMAPXInputStream *stream, ...@@ -560,6 +561,7 @@ imapx_parse_capability (CamelIMAPXInputStream *stream,
GINT_TO_POINTER (1)); GINT_TO_POINTER (1));
break; break;
} }
/* falls through */
case IMAPX_TOK_INT: case IMAPX_TOK_INT:
cinfo->capa |= imapx_lookup_capability ((gchar *) token); cinfo->capa |= imapx_lookup_capability ((gchar *) token);
if (free_token) { if (free_token) {
......
...@@ -345,7 +345,7 @@ gint string_equal (const gchar *a, const gchar *b) ...@@ -345,7 +345,7 @@ gint string_equal (const gchar *a, const gchar *b)
bp++; bp++;
if (ap - a != bp - a if (ap - a != bp - a
&& ap - 1 > 0 && ap - a > 0
&& memcmp (a, b, ap - a) != 0) { && memcmp (a, b, ap - a) != 0) {
return 0; return 0;
} }
......
...@@ -370,8 +370,9 @@ stripped_char (gunichar ch) ...@@ -370,8 +370,9 @@ stripped_char (gunichar ch)
/* Ignore those */ /* Ignore those */
return 0; return 0;
default: default:
/* Convert to lowercase, fall through */ /* Convert to lowercase */
ch = g_unichar_tolower (ch); ch = g_unichar_tolower (ch);
/* falls through */
case G_UNICODE_LOWERCASE_LETTER: case G_UNICODE_LOWERCASE_LETTER:
if ((dlen = g_unichar_fully_decompose (ch, FALSE, decomp, 4))) { if ((dlen = g_unichar_fully_decompose (ch, FALSE, decomp, 4))) {
retval = decomp[0]; retval = decomp[0];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment