[evolution] Correct how extra compiler warnings are used in the maintainer mode



commit dc9ec0222772457223e87af8f9f99b9c8fef05af
Author: Milan Crha <mcrha redhat com>
Date:   Wed Nov 14 12:58:37 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/gui/widgets/e-minicard-view.c         |  1 +
 src/calendar/gui/e-week-view.c                        |  1 +
 src/calendar/gui/itip-utils.c                         |  1 +
 src/e-util/e-html-utils.c                             |  4 ++--
 src/e-util/e-misc-utils.c                             |  1 +
 src/e-util/e-send-options.c                           |  1 +
 src/e-util/e-table-click-to-add.c                     |  1 +
 src/e-util/e-table.c                                  | 11 ++++++-----
 src/e-util/gal-a11y-e-table-column-header.c           |  1 +
 src/modules/itip-formatter/itip-view.c                |  1 +
 src/plugins/email-custom-header/email-custom-header.c |  1 +
 12 files changed, 23 insertions(+), 12 deletions(-)
---
diff --git a/cmake/modules/SetupBuildFlags.cmake b/cmake/modules/SetupBuildFlags.cmake
index 10b12bd0cc..4c6154129b 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/gui/widgets/e-minicard-view.c b/src/addressbook/gui/widgets/e-minicard-view.c
index 862329406d..c368d656e1 100644
--- a/src/addressbook/gui/widgets/e-minicard-view.c
+++ b/src/addressbook/gui/widgets/e-minicard-view.c
@@ -416,6 +416,7 @@ e_minicard_view_event (GnomeCanvasItem *item,
                                e_minicard_view_create_contact (view);
                        return TRUE;
                }
+               break;
        case GDK_BUTTON_PRESS:
                gdk_event_get_button (event, &event_button);
                if (event_button == 3)
diff --git a/src/calendar/gui/e-week-view.c b/src/calendar/gui/e-week-view.c
index cb1e96e464..ad1ae1b57c 100644
--- a/src/calendar/gui/e-week-view.c
+++ b/src/calendar/gui/e-week-view.c
@@ -3679,6 +3679,7 @@ tooltip_event_cb (GnomeCanvasItem *item,
                case GDK_KEY_PRESS:
                case GDK_BUTTON_PRESS:
                        tooltip_destroy (view, item);
+                       return FALSE;
                default:
                        return FALSE;
        }
diff --git a/src/calendar/gui/itip-utils.c b/src/calendar/gui/itip-utils.c
index 64a5436b9f..23d1769ada 100644
--- a/src/calendar/gui/itip-utils.c
+++ b/src/calendar/gui/itip-utils.c
@@ -773,6 +773,7 @@ comp_from (ECalComponentItipMethod method,
                if (!e_cal_component_has_attendees (comp))
                        return NULL;
                /* coverity[fallthrough] */
+               /* falls through */
 
        case E_CAL_COMPONENT_METHOD_CANCEL:
 
diff --git a/src/e-util/e-html-utils.c b/src/e-util/e-html-utils.c
index 73f508b251..99ead9f7c4 100644
--- a/src/e-util/e-html-utils.c
+++ b/src/e-util/e-html-utils.c
@@ -444,7 +444,7 @@ e_text_to_html_full (const gchar *input,
                                } while (col % 8);
                                break;
                        }
-                       /* otherwise, FALL THROUGH */
+                       /* falls through */
 
                case ' ':
                        if (flags & E_TEXT_TO_HTML_CONVERT_SPACES) {
@@ -457,7 +457,7 @@ e_text_to_html_full (const gchar *input,
                                        break;
                                }
                        }
-                       /* otherwise, FALL THROUGH */
+                       /* falls through */
 
                default:
                        if ((u >= 0x20 && u < 0x80) ||
diff --git a/src/e-util/e-misc-utils.c b/src/e-util/e-misc-utils.c
index 8c7e5c544d..e5982cd25e 100644
--- a/src/e-util/e-misc-utils.c
+++ b/src/e-util/e-misc-utils.c
@@ -1695,6 +1695,7 @@ e_format_number (gint number)
                        last_count = *grouping;
                        grouping++;
                        /* coverity[fallthrough] */
+                       /* falls through */
                case 0:
                        divider = epow10 (last_count);
                        if (number >= divider) {
diff --git a/src/e-util/e-send-options.c b/src/e-util/e-send-options.c
index 580c08767b..02e4577358 100644
--- a/src/e-util/e-send-options.c
+++ b/src/e-util/e-send-options.c
@@ -636,6 +636,7 @@ e_send_options_cb (GtkDialog *dialog,
                case GTK_RESPONSE_OK:
                        e_send_options_get_widgets_data (sod);
                        /* coverity[fallthrough] */
+                       /* falls through */
                case GTK_RESPONSE_CANCEL:
                        gtk_widget_hide (priv->main);
                        gtk_widget_destroy (priv->main);
diff --git a/src/e-util/e-table-click-to-add.c b/src/e-util/e-table-click-to-add.c
index 386cb878b0..59138c3398 100644
--- a/src/e-util/e-table-click-to-add.c
+++ b/src/e-util/e-table-click-to-add.c
@@ -445,6 +445,7 @@ etcta_event (GnomeCanvasItem *item,
                if (!e->focus_change.in)
                        return TRUE;
                /* coverity[fallthrough] */
+               /* falls through */
 
        case GDK_BUTTON_PRESS:
                if (etcta->text) {
diff --git a/src/e-util/e-table.c b/src/e-util/e-table.c
index 98c8decf7e..f26567bff4 100644
--- a/src/e-util/e-table.c
+++ b/src/e-util/e-table.c
@@ -1418,13 +1418,14 @@ canvas_vbox_event (ECanvasVbox *vbox,
                case GDK_KEY_ISO_Left_Tab:
                        if ((key->state & GDK_CONTROL_MASK) && etable->click_to_add) {
                                gnome_canvas_item_grab_focus (etable->click_to_add);
-                               break;
+                               return TRUE;
                        }
+                       break;
                default:
-                       return FALSE;
+                       break;
        }
 
-       return TRUE;
+       return FALSE;
 }
 
 static void
@@ -1459,11 +1460,11 @@ click_to_add_event (ETableClickToAdd *etcta,
                                                        gtk_widget_get_toplevel (
                                                        GTK_WIDGET (etable->table_canvas)),
                                                        GTK_DIR_TAB_FORWARD);
-                                       break;
                                }
                        }
+                       break;
                default:
-                       return FALSE;
+                       break;
        }
 
        return FALSE;
diff --git a/src/e-util/gal-a11y-e-table-column-header.c b/src/e-util/gal-a11y-e-table-column-header.c
index ee5ea3bb17..18ff0f8d13 100644
--- a/src/e-util/gal-a11y-e-table-column-header.c
+++ b/src/e-util/gal-a11y-e-table-column-header.c
@@ -136,6 +136,7 @@ gal_a11y_e_table_column_header_do_action (AtkAction *action,
                        else
                                break;
                        ethi_change_sort_state (ethi, col, E_TABLE_HEADER_ITEM_SORT_FLAG_NONE);
+                       break;
                default:
                        return_value = FALSE;
                        break;
diff --git a/src/modules/itip-formatter/itip-view.c b/src/modules/itip-formatter/itip-view.c
index d8797c708d..190b1fa56a 100644
--- a/src/modules/itip-formatter/itip-view.c
+++ b/src/modules/itip-formatter/itip-view.c
@@ -6268,6 +6268,7 @@ itip_view_init_view (ItipView *view)
                                 /* FIXME What about the name? */
                                itip_view_set_delegator (view, view->priv->delegator_name ? 
view->priv->delegator_name : view->priv->delegator_address);
                                /* coverity[fallthrough] */
+                               /* falls through */
                        case ICAL_METHOD_PUBLISH:
                        case ICAL_METHOD_ADD:
                        case ICAL_METHOD_CANCEL:
diff --git a/src/plugins/email-custom-header/email-custom-header.c 
b/src/plugins/email-custom-header/email-custom-header.c
index 202a990b20..788d110e75 100644
--- a/src/plugins/email-custom-header/email-custom-header.c
+++ b/src/plugins/email-custom-header/email-custom-header.c
@@ -177,6 +177,7 @@ epech_header_options_cb (GtkDialog *dialog,
                case GTK_RESPONSE_OK:
                        epech_get_widgets_data (mch);
                        /* coverity[fallthrough] */
+                       /* falls through */
                case GTK_RESPONSE_CANCEL:
                        gtk_widget_hide (priv->main);
                        gtk_widget_destroy (priv->main);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]