[parted-devel] [PATCH 04/24] libparted: Avoid a GCC warning for unused functions

Brian C. Lane bcl at redhat.com
Sat Nov 14 00:11:47 GMT 2020


From: Shin'ichiro Kawasaki <kawasaki at juno.dti.ne.jp>

libparted/fs/r/hfs/hfs.c has a '#if 0' block. The block refers two
functions hfsplus_clobber() and hfs_clobber(). It have GCC report a
warning below.

  CC       r/hfs/hfs.lo
r/hfs/hfs.c:343:1: warning: 'hfsplus_clobber' defined but not used [-Wunused-function]
  343 | hfsplus_clobber (PedGeometry* geom)
      | ^~~~~~~~~~~~~~~

To avoid the warning, add two more '#if 0' to disable the two functions.

Signed-off-by: Shin'ichiro Kawasaki <kawasaki at juno.dti.ne.jp>
Signed-off-by: Brian C. Lane <bcl at redhat.com>
---
 libparted/fs/r/hfs/hfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c
index 6be0390..0aababd 100644
--- a/libparted/fs/r/hfs/hfs.c
+++ b/libparted/fs/r/hfs/hfs.c
@@ -59,6 +59,7 @@ static PedFileSystemType hfsplus_type;
 
 /* ----- HFS ----- */
 
+#if 0
 /* This is a very unundoable operation */
 /* Maybe I shouldn't touch the alternate MDB ? */
 /* Anyway clobber is call before other fs creation */
@@ -78,6 +79,7 @@ hfs_clobber (PedGeometry* geom)
 		(!!ped_geometry_write (geom, buf, geom->length - 1, 1)) &
 		(!!ped_geometry_sync  (geom));
 }
+#endif
 
 PedFileSystem *
 hfs_open (PedGeometry* geom)
@@ -339,6 +341,7 @@ hfs_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
 #include "reloc_plus.h"
 #include "journal.h"
 
+#if 0
 static int
 hfsplus_clobber (PedGeometry* geom)
 {
@@ -374,6 +377,7 @@ hfsplus_clobber (PedGeometry* geom)
 	/* non-embedded or envelop destroy as hfs */
 	return ( hfs_clobber (geom) && i );
 }
+#endif
 
 int
 hfsplus_close (PedFileSystem *fs)
-- 
2.26.2




More information about the parted-devel mailing list