[libgda] Avoid an implicit fallthrough warning with gcc 7.



commit 30a128788a8301cea13d7bbc51fdc43161362fb6
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Oct 29 21:10:30 2017 +0100

    Avoid an implicit fallthrough warning with gcc 7.
    
    See
    https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
    
    This was the warning:
    
    gda-meta-store.c: In function ‘handle_schema_version’:
    gda-meta-store.c:2804:5: error: this statement may fall through [-Werror=implicit-fallthrough=]
         migrate_schema_from_v1_to_v2 (store, error);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    gda-meta-store.c:2805:4: note: here
        case 2:
        ^~~~
    gda-meta-store.c:2806:5: error: this statement may fall through [-Werror=implicit-fallthrough=]
         migrate_schema_from_v2_to_v3 (store, error);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    gda-meta-store.c:2807:4: note: here
        case 3:
        ^~~~

 libgda/gda-meta-store.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/libgda/gda-meta-store.c b/libgda/gda-meta-store.c
index a914c3f..9268dac 100644
--- a/libgda/gda-meta-store.c
+++ b/libgda/gda-meta-store.c
@@ -2802,10 +2802,13 @@ handle_schema_version (GdaMetaStore *store, gboolean *schema_present, GError **e
                        switch (store->priv->version) {
                        case 1:
                                migrate_schema_from_v1_to_v2 (store, error);
+                                /* fallthrough */
                        case 2:
                                migrate_schema_from_v2_to_v3 (store, error);
+                                /* fallthrough */
                        case 3:
                                migrate_schema_from_v3_to_v4 (store, error);
+                                /* fallthrough */
                        case 4:
                                /* function call for migration from V4 will be here */
                                break;


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