[parted-devel] [PATCH 2/2] Fix warnings from GCC 7's -Wimplicit-fallthrough

dann frazier dann.frazier at canonical.com
Fri Aug 31 16:28:28 BST 2018


All of these locations appear to have intentional fallthroughs. Add
comments that GCC will detect to mute warnings w/ -Wimplicit-fallthrough.
---
 libparted/arch/linux.c | 8 ++++++++
 libparted/labels/rdb.c | 1 +
 2 files changed, 9 insertions(+)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 4c778ea9..02d7a52c 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -961,6 +961,7 @@ init_ide (PedDevice* dev)
 
                         case PED_EXCEPTION_UNHANDLED:
                                 ped_exception_catch ();
+                                /* FALLTHROUGH */
                         case PED_EXCEPTION_IGNORE:
                                 dev->model = strdup(_("Generic IDE"));
                                 break;
@@ -998,6 +999,7 @@ init_ide (PedDevice* dev)
 
                                 case PED_EXCEPTION_UNHANDLED:
                                         ped_exception_catch ();
+                                        /* FALLTHROUGH */
                                 case PED_EXCEPTION_IGNORE:
                                         break;
                                 default:
@@ -1347,6 +1349,7 @@ init_generic (PedDevice* dev, const char* model_name)
 
                         case PED_EXCEPTION_UNHANDLED:
                                 ped_exception_catch ();
+                                /* FALLTHROUGH */
                         case PED_EXCEPTION_IGNORE:
                                 break;
                         default:
@@ -1890,6 +1893,7 @@ linux_read (const PedDevice* dev, void* buffer, PedSector start,
 
                         case PED_EXCEPTION_UNHANDLED:
                                 ped_exception_catch ();
+                                /* FALLTHROUGH */
                         case PED_EXCEPTION_CANCEL:
                                 return 0;
                         default:
@@ -1933,6 +1937,7 @@ linux_read (const PedDevice* dev, void* buffer, PedSector start,
 
                         case PED_EXCEPTION_UNHANDLED:
                                 ped_exception_catch ();
+                                /* FALLTHROUGH */
                         case PED_EXCEPTION_CANCEL:
                                 free(diobuf);
                                 return 0;
@@ -2032,6 +2037,7 @@ linux_write (PedDevice* dev, const void* buffer, PedSector start,
 
                         case PED_EXCEPTION_UNHANDLED:
                                 ped_exception_catch ();
+                                /* FALLTHROUGH */
                         case PED_EXCEPTION_CANCEL:
                                 return 0;
                         default:
@@ -2075,6 +2081,7 @@ linux_write (PedDevice* dev, const void* buffer, PedSector start,
 
                         case PED_EXCEPTION_UNHANDLED:
                                 ped_exception_catch ();
+                                /* FALLTHROUGH */
                         case PED_EXCEPTION_CANCEL:
                                 free(diobuf_start);
                                 return 0;
@@ -2146,6 +2153,7 @@ _do_fsync (PedDevice* dev)
 
                         case PED_EXCEPTION_UNHANDLED:
                                 ped_exception_catch ();
+                                /* FALLTHROUGH */
                         case PED_EXCEPTION_CANCEL:
                                 return 0;
                         default:
diff --git a/libparted/labels/rdb.c b/libparted/labels/rdb.c
index 34b59aa6..48e8d7a9 100644
--- a/libparted/labels/rdb.c
+++ b/libparted/labels/rdb.c
@@ -175,6 +175,7 @@ _amiga_read_block (const PedDevice *dev, struct AmigaBlock *blk,
 				_amiga_calculate_checksum(AMIGA(blk));
 				if (!ped_device_write ((PedDevice*)dev, blk, block, 1))
 					return NULL;
+				/* FALLTHROUGH */
 			case PED_EXCEPTION_IGNORE :
 			case PED_EXCEPTION_UNHANDLED :
 			default :
-- 
2.19.0.rc1




More information about the parted-devel mailing list