GNU bug report logs - #16053
[PATCH 1/2] "-Wall -Wextra -Werror" compilation patches - part 1/2

Previous Next

Package: parted;

Reported by: Doron Tsur <doront <at> mellanox.com>

Date: Wed, 4 Dec 2013 16:17:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 16053 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#16053; Package parted. (Wed, 04 Dec 2013 16:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Doron Tsur <doront <at> mellanox.com>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Wed, 04 Dec 2013 16:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Doron Tsur <doront <at> mellanox.com>
To: bug-parted <at> gnu.org
Cc: Doron Tsur <doront <at> mellanox.com>, itaib <at> mellanox.com
Subject: [PATCH 1/2] "-Wall -Wextra -Werror" compilation patches - part 1/2
Date: Wed,  4 Dec 2013 16:32:27 +0200
Tests: Ubuntu 13.10 compilation
.../configure --prefix=/usr --without-readline CFLAGS="-Wall -Wextra -Werror" && make

Signed-off-by: Doron Tsur <doront <at> mellanox.com>
---
 libparted/arch/linux.c          |   10 +++++-----
 libparted/fs/amiga/apfs.c       |    2 +-
 libparted/fs/r/fat/fat.c        |    4 ++--
 libparted/fs/r/fat/table.c      |    2 +-
 libparted/fs/r/hfs/hfs.c        |    4 ++++
 libparted/fs/r/hfs/journal.c    |    2 +-
 libparted/fs/r/hfs/reloc.c      |    6 +++---
 libparted/fs/r/hfs/reloc_plus.c |    8 ++++----
 libparted/labels/aix.c          |   30 +++++++++++++++---------------
 libparted/labels/bsd.c          |    6 +++---
 libparted/labels/dos.c          |   10 +++++-----
 libparted/labels/dvh.c          |    6 +++---
 libparted/labels/gpt.c          |   10 +++++-----
 libparted/labels/loop.c         |   14 +++++++-------
 libparted/labels/mac.c          |    6 +++---
 libparted/labels/pc98.c         |    6 +++---
 libparted/labels/pt-tools.c     |    4 ++--
 libparted/labels/rdb.c          |    6 +++---
 libparted/labels/sun.c          |    6 +++---
 parted/parted.c                 |    6 +++---
 parted/table.c                  |    3 ++-
 parted/ui.c                     |    8 ++++----
 22 files changed, 82 insertions(+), 77 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index f43eae1..4ce75cd 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -1643,7 +1643,7 @@ retry:
 }
 
 static int
-linux_refresh_open (PedDevice* dev)
+linux_refresh_open (PedDevice* dev __attribute__((unused)))
 {
         return 1;
 }
@@ -1958,7 +1958,7 @@ linux_write (PedDevice* dev, const void* buffer, PedSector start,
         diobuf_start = diobuf;
         while (1) {
                 ssize_t status = write (arch_specific->fd, diobuf, write_length);
-                if (status == write_length) break;
+                if ((size_t)status == write_length) break;
                 if (status > 0) {
                         write_length -= status;
                         diobuf = (char *) diobuf + status;
@@ -2506,7 +2506,7 @@ _sysfs_int_entry_from_dev(PedDevice const* dev, const char *entry, int *val)
         char        path[128];
         int r = snprintf(path, sizeof(path), "/sys/block/%s/%s",
 			 last_component(dev->path), entry);
-        if (r < 0 || r >= sizeof(path))
+        if (r < 0 || ((size_t)r) >= sizeof(path))
                 return false;
 
         FILE *fp = fopen(path, "r");
@@ -2536,7 +2536,7 @@ _sysfs_ull_entry_from_part(PedPartition const* part, const char *entry,
                 last_component(part->disk->dev->path),
                 last_component(part_name), entry);
         free(part_name);
-        if (r < 0 || r >= sizeof(path))
+        if (r < 0 || ((size_t)r) >= sizeof(path))
                 return false;
 
         FILE *fp = fopen(path, "r");
@@ -2794,7 +2794,7 @@ _disk_sync_part_table (PedDisk* disk)
 
         /* lpn = largest partition number. */
         if (ped_disk_get_max_supported_partition_count(disk, &lpn))
-                lpn = PED_MIN(lpn, part_range);
+                lpn = (int)PED_MIN(((unsigned int)lpn), part_range);
         else
                 lpn = part_range;
 
diff --git a/libparted/fs/amiga/apfs.c b/libparted/fs/amiga/apfs.c
index 9f9e6e0..99467db 100644
--- a/libparted/fs/amiga/apfs.c
+++ b/libparted/fs/amiga/apfs.c
@@ -33,7 +33,7 @@
 #endif /* ENABLE_NLS */
 
 static int
-_apfs_probe_root (uint32_t *block, uint32_t blocksize, uint32_t kind) {
+_apfs_probe_root (uint32_t *block, uint32_t blocksize __attribute__((unused)), uint32_t kind) {
 	if (PED_BE32_TO_CPU (block[0]) != kind) return 0;
 	return 1;
 }
diff --git a/libparted/fs/r/fat/fat.c b/libparted/fs/r/fat/fat.c
index c8e4552..b6bebd9 100644
--- a/libparted/fs/r/fat/fat.c
+++ b/libparted/fs/r/fat/fat.c
@@ -203,7 +203,7 @@ fat_root_dir_clear (PedFileSystem* fs)
 }
 
 PedFileSystem*
-fat_create (PedGeometry* geom, FatType fat_type, PedTimer* timer)
+fat_create (PedGeometry* geom, FatType fat_type, PedTimer* timer __attribute__((unused)))
 {
 	PedFileSystem*		fs;
 	FatSpecific*		fs_info;
@@ -418,7 +418,7 @@ error:
 }
 
 int
-fat_check (PedFileSystem* fs, PedTimer* timer)
+fat_check (PedFileSystem* fs, PedTimer* timer __attribute__((unused)))
 {
 	FatSpecific*	fs_info = FAT_SPECIFIC (fs);
 	PedSector	cluster_sectors;
diff --git a/libparted/fs/r/fat/table.c b/libparted/fs/r/fat/table.c
index 974dea8..4c9b042 100644
--- a/libparted/fs/r/fat/table.c
+++ b/libparted/fs/r/fat/table.c
@@ -198,7 +198,7 @@ fat_table_compare (const FatTable* a, const FatTable* b)
 }
 
 static int
-_test_code_available (const FatTable* ft, FatCluster code)
+_test_code_available (const FatTable* ft __attribute__((unused)), FatCluster code)
 {
 	return code == 0;
 }
diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c
index 26c789a..b032781 100644
--- a/libparted/fs/r/hfs/hfs.c
+++ b/libparted/fs/r/hfs/hfs.c
@@ -63,6 +63,7 @@ static PedFileSystemType hfsplus_type;
 /* Maybe I shouldn't touch the alternate MDB ? */
 /* Anyway clobber is call before other fs creation */
 /* So this is a non-issue */
+#if 0
 static int
 hfs_clobber (PedGeometry* geom)
 {
@@ -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)
diff --git a/libparted/fs/r/hfs/journal.c b/libparted/fs/r/hfs/journal.c
index 54a065d..83a6372 100644
--- a/libparted/fs/r/hfs/journal.c
+++ b/libparted/fs/r/hfs/journal.c
@@ -99,7 +99,7 @@ hfsj_update_jl(PedFileSystem* fs, uint32_t block)
 /* Return the sector in the journal that is after the area read */
 /* or 0 on error */
 static PedSector
-hfsj_journal_read(PedGeometry* geom, HfsJJournalHeader* jh,
+hfsj_journal_read(PedGeometry* geom, HfsJJournalHeader* jh __attribute__((unused)),
 		  PedSector journ_sect, PedSector journ_length,
 		  PedSector read_sect, unsigned int nb_sect,
 		  void* buf)
diff --git a/libparted/fs/r/hfs/reloc.c b/libparted/fs/r/hfs/reloc.c
index abc6b1b..0e1e833 100644
--- a/libparted/fs/r/hfs/reloc.c
+++ b/libparted/fs/r/hfs/reloc.c
@@ -315,7 +315,7 @@ hfs_move_extent_starting_at (PedFileSystem *fs, unsigned int *ptr_fblock,
 
 static int
 hfs_cache_from_mdb(HfsCPrivateCache* cache, PedFileSystem* fs,
-		   PedTimer* timer)
+		   PedTimer* timer __attribute__((unused)))
 {
 	HfsPrivateFSData* 	priv_data = (HfsPrivateFSData*)
 						fs->type_specific;
@@ -359,7 +359,7 @@ hfs_cache_from_mdb(HfsCPrivateCache* cache, PedFileSystem* fs,
 
 static int
 hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
-		   PedTimer* timer)
+		   PedTimer* timer __attribute__((unused)))
 {
 	HfsPrivateFSData* 	priv_data = (HfsPrivateFSData*)
 						fs->type_specific;
@@ -454,7 +454,7 @@ hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
 
 static int
 hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
-		   PedTimer* timer)
+		   PedTimer* timer __attribute__((unused)))
 {
 	HfsPrivateFSData* 	priv_data = (HfsPrivateFSData*)
 						fs->type_specific;
diff --git a/libparted/fs/r/hfs/reloc_plus.c b/libparted/fs/r/hfs/reloc_plus.c
index 6c2408c..fd2c2c1 100644
--- a/libparted/fs/r/hfs/reloc_plus.c
+++ b/libparted/fs/r/hfs/reloc_plus.c
@@ -379,7 +379,7 @@ hfsplus_move_extent_starting_at (PedFileSystem *fs, unsigned int *ptr_fblock,
 
 static int
 hfsplus_cache_from_vh(HfsCPrivateCache* cache, PedFileSystem* fs,
-		      PedTimer* timer)
+		      PedTimer* timer __attribute__((unused)))
 {
 	HfsPPrivateFSData* 	priv_data = (HfsPPrivateFSData*)
 						fs->type_specific;
@@ -471,7 +471,7 @@ hfsplus_cache_from_vh(HfsCPrivateCache* cache, PedFileSystem* fs,
 
 static int
 hfsplus_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
-			   PedTimer* timer)
+			   PedTimer* timer __attribute__((unused)))
 {
 	HfsPPrivateFSData* 	priv_data = (HfsPPrivateFSData*)
 						fs->type_specific;
@@ -597,7 +597,7 @@ hfsplus_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
 
 static int
 hfsplus_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
-			  PedTimer* timer)
+			  PedTimer* timer __attribute__((unused)))
 {
 	HfsPPrivateFSData* 	priv_data = (HfsPPrivateFSData*)
 						fs->type_specific;
@@ -711,7 +711,7 @@ hfsplus_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
 
 static int
 hfsplus_cache_from_attributes(HfsCPrivateCache* cache, PedFileSystem* fs,
-			      PedTimer* timer)
+			      PedTimer* timer __attribute__((unused)))
 {
 	HfsPPrivateFSData* 	priv_data = (HfsPPrivateFSData*)
 						fs->type_specific;
diff --git a/libparted/labels/aix.c b/libparted/labels/aix.c
index 98de112..f76829d 100644
--- a/libparted/labels/aix.c
+++ b/libparted/labels/aix.c
@@ -107,7 +107,7 @@ aix_read (PedDisk* disk)
 
 #ifndef DISCOVER_ONLY
 static int
-aix_write (const PedDisk* disk)
+aix_write (const PedDisk* disk __attribute__((unused)))
 {
         ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
                              PED_EXCEPTION_CANCEL,
@@ -118,9 +118,9 @@ aix_write (const PedDisk* disk)
 #endif /* !DISCOVER_ONLY */
 
 static PedPartition*
-aix_partition_new (const PedDisk* disk, PedPartitionType part_type,
-		   const PedFileSystemType* fs_type,
-		   PedSector start, PedSector end)
+aix_partition_new (const PedDisk* disk __attribute__((unused)), PedPartitionType part_type __attribute__((unused)),
+		   const PedFileSystemType* fs_type __attribute__((unused)),
+		   PedSector start __attribute__((unused)), PedSector end __attribute__((unused)))
 {
         ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
                              PED_EXCEPTION_CANCEL,
@@ -130,7 +130,7 @@ aix_partition_new (const PedDisk* disk, PedPartitionType part_type,
 }
 
 static PedPartition*
-aix_partition_duplicate (const PedPartition* part)
+aix_partition_duplicate (const PedPartition* part __attribute__((unused)))
 {
         ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
                              PED_EXCEPTION_CANCEL,
@@ -148,7 +148,7 @@ aix_partition_destroy (PedPartition* part)
 }
 
 static int
-aix_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
+aix_partition_set_system (PedPartition* part __attribute__((unused)), const PedFileSystemType* fs_type __attribute__((unused)))
 {
         ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
                              PED_EXCEPTION_CANCEL,
@@ -158,7 +158,7 @@ aix_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
 }
 
 static int
-aix_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+aix_partition_set_flag (PedPartition* part __attribute__((unused)), PedPartitionFlag flag __attribute__((unused)), int state __attribute__((unused)))
 {
         ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
                              PED_EXCEPTION_CANCEL,
@@ -168,35 +168,35 @@ aix_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
 }
 
 static int _GL_ATTRIBUTE_CONST
-aix_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+aix_partition_get_flag (const PedPartition* part __attribute__((unused)), PedPartitionFlag flag __attribute__((unused)))
 {
         return 0;
 }
 
 
 static int
-aix_partition_is_flag_available (const PedPartition* part,
-				 PedPartitionFlag flag)
+aix_partition_is_flag_available (const PedPartition* part __attribute__((unused)),
+				 PedPartitionFlag flag __attribute__((unused)))
 {
         return 0;
 }
 
 
 static int
-aix_get_max_primary_partition_count (const PedDisk* disk)
+aix_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return 4;
 }
 
 static bool
-aix_get_max_supported_partition_count (const PedDisk* disk, int *max_n)
+aix_get_max_supported_partition_count (const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = MAX_TOTAL_PART;
 	return true;
 }
 
 static int _GL_ATTRIBUTE_PURE
-aix_partition_align (PedPartition* part, const PedConstraint* constraint)
+aix_partition_align (PedPartition* part, const PedConstraint* constraint __attribute__((unused)))
 {
         PED_ASSERT (part != NULL);
 
@@ -204,13 +204,13 @@ aix_partition_align (PedPartition* part, const PedConstraint* constraint)
 }
 
 static int _GL_ATTRIBUTE_PURE
-aix_partition_enumerate (PedPartition* part)
+aix_partition_enumerate (PedPartition* part __attribute__((unused)))
 {
 	return 1;
 }
 
 static int _GL_ATTRIBUTE_PURE
-aix_alloc_metadata (PedDisk* disk)
+aix_alloc_metadata (PedDisk* disk __attribute__((unused)))
 {
 	return 1;
 }
diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c
index 79332ab..9c76d4d 100644
--- a/libparted/labels/bsd.c
+++ b/libparted/labels/bsd.c
@@ -520,7 +520,7 @@ bsd_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
 }
 
 static int
-bsd_partition_is_flag_available (const PedPartition* part,
+bsd_partition_is_flag_available (const PedPartition* part __attribute__((unused)),
 				 PedPartitionFlag flag)
 {
 	switch (flag) {
@@ -536,13 +536,13 @@ bsd_partition_is_flag_available (const PedPartition* part,
 
 
 static int
-bsd_get_max_primary_partition_count (const PedDisk* disk)
+bsd_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return BSD_MAXPARTITIONS;
 }
 
 static bool
-bsd_get_max_supported_partition_count(const PedDisk* disk, int *max_n)
+bsd_get_max_supported_partition_count(const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = BSD_MAXPARTITIONS;
 	return true;
diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
index 6bddd79..68d31e7 100644
--- a/libparted/labels/dos.c
+++ b/libparted/labels/dos.c
@@ -240,7 +240,7 @@ msdos_probe (const PedDevice *dev)
 
 	PED_ASSERT (dev != NULL);
 
-        if (dev->sector_size < sizeof *part_table)
+        if (((size_t)(dev->sector_size)) < sizeof *part_table)
                 return 0;
 
 	void *label;
@@ -374,7 +374,7 @@ msdos_disk_get_flag (const PedDisk *disk, PedDiskFlag flag)
 }
 
 static int
-msdos_disk_is_flag_available (const PedDisk *disk, PedDiskFlag flag)
+msdos_disk_is_flag_available (const PedDisk *disk __attribute__((unused)), PedDiskFlag flag)
 {
         switch (flag) {
         case PED_DISK_CYLINDER_ALIGNMENT:
@@ -404,7 +404,7 @@ chs_get_sector (const RawCHS* chs)
 }
 
 static PedSector _GL_ATTRIBUTE_PURE
-chs_to_sector (const PedDevice* dev, const PedCHSGeometry *bios_geom,
+chs_to_sector (const PedDevice* dev __attribute__((unused)), const PedCHSGeometry *bios_geom,
 	       const RawCHS* chs)
 {
 	PedSector	c;		/* not measured in sectors, but need */
@@ -2428,13 +2428,13 @@ msdos_partition_enumerate (PedPartition* part)
 }
 
 static int
-msdos_get_max_primary_partition_count (const PedDisk* disk)
+msdos_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return DOS_N_PRI_PARTITIONS;
 }
 
 static bool
-msdos_get_max_supported_partition_count(const PedDisk* disk, int *max_n)
+msdos_get_max_supported_partition_count(const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = MAX_TOTAL_PART;
 	return true;
diff --git a/libparted/labels/dvh.c b/libparted/labels/dvh.c
index 91b9080..72a3e53 100644
--- a/libparted/labels/dvh.c
+++ b/libparted/labels/dvh.c
@@ -682,7 +682,7 @@ dvh_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
 }
 
 static int
-dvh_partition_is_flag_available (const PedPartition* part,
+dvh_partition_is_flag_available (const PedPartition* part __attribute__((unused)),
 				  PedPartitionFlag flag)
 {
 	switch (flag) {
@@ -815,13 +815,13 @@ dvh_partition_enumerate (PedPartition* part)
 }
 
 static int
-dvh_get_max_primary_partition_count (const PedDisk* disk)
+dvh_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return NPARTAB;
 }
 
 static bool
-dvh_get_max_supported_partition_count (const PedDisk* disk, int *max_n)
+dvh_get_max_supported_partition_count (const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = NPARTAB;
 	return true;
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 66c96e6..d7af6df 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -305,7 +305,7 @@ pth_get_size (const PedDevice *dev)
 }
 
 static inline uint32_t
-pth_get_size_static (const PedDevice *dev)
+pth_get_size_static (const PedDevice *dev __attribute__((unused)))
 {
   return sizeof (GuidPartitionTableHeader_t) - sizeof (uint8_t *);
 }
@@ -651,7 +651,7 @@ _header_is_valid (PedDisk const *disk, GuidPartitionTableHeader_t *gpt,
             && pe_size <= (UINT32_MAX >> 4)))
     return 0;
 
-  if (PED_LE64_TO_CPU (gpt->MyLBA) != my_lba)
+  if (((PedSector)PED_LE64_TO_CPU (gpt->MyLBA)) != my_lba)
     return 0;
 
   PedSector alt_lba = PED_LE64_TO_CPU (gpt->AlternateLBA);
@@ -886,7 +886,7 @@ gpt_read_headers (PedDisk const *disk,
 
   gpt_disk_data->AlternateLBA =
     (valid_primary
-     ? PED_LE64_TO_CPU (pri->AlternateLBA)
+     ? (PedSector)PED_LE64_TO_CPU (pri->AlternateLBA)
      : dev->length - 1);
 
   void *s_bak;
@@ -1562,7 +1562,7 @@ gpt_disk_set_flag (PedDisk *disk, PedDiskFlag flag, int state)
 }
 
 static int
-gpt_disk_is_flag_available(const PedDisk *disk, PedDiskFlag flag)
+gpt_disk_is_flag_available(const PedDisk *disk __attribute__((unused)), PedDiskFlag flag)
 {
   switch (flag)
     {
@@ -1788,7 +1788,7 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag)
 }
 
 static int
-gpt_partition_is_flag_available (const PedPartition *part,
+gpt_partition_is_flag_available (const PedPartition *part __attribute__((unused)),
                                  PedPartitionFlag flag)
 {
   switch (flag)
diff --git a/libparted/labels/loop.c b/libparted/labels/loop.c
index ea8f007..aa97bbd 100644
--- a/libparted/labels/loop.c
+++ b/libparted/labels/loop.c
@@ -223,13 +223,13 @@ loop_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
 }
 
 static int
-loop_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
+loop_partition_set_flag (PedPartition* part __attribute__((unused)), PedPartitionFlag flag __attribute__((unused)), int state __attribute__((unused)))
 {
 	return 0;
 }
 
 static int
-loop_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
+loop_partition_get_flag (const PedPartition* part __attribute__((unused)), PedPartitionFlag flag __attribute__((unused)))
 {
 	return 0;
 }
@@ -254,8 +254,8 @@ loop_partition_align (PedPartition* part, const PedConstraint* constraint)
 }
 
 static int
-loop_partition_is_flag_available (const PedPartition* part,
-	       			  PedPartitionFlag flag)
+loop_partition_is_flag_available (const PedPartition* part __attribute__((unused)),
+				  PedPartitionFlag flag __attribute__((unused)))
 {
 	return 0;
 }
@@ -268,19 +268,19 @@ loop_partition_enumerate (PedPartition* part)
 }
 
 static int
-loop_alloc_metadata (PedDisk* disk)
+loop_alloc_metadata (PedDisk* disk __attribute__((unused)))
 {
 	return 1;
 }
 
 static int
-loop_get_max_primary_partition_count (const PedDisk* disk)
+loop_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return 1;
 }
 
 static bool
-loop_get_max_supported_partition_count (const PedDisk* disk, int *max_n)
+loop_get_max_supported_partition_count (const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = 1;
 	return true;
diff --git a/libparted/labels/mac.c b/libparted/labels/mac.c
index f26f8e5..003b9c3 100644
--- a/libparted/labels/mac.c
+++ b/libparted/labels/mac.c
@@ -202,7 +202,7 @@ mac_probe (const PedDevice * dev)
 {
 	PED_ASSERT (dev != NULL);
 
-        if (dev->sector_size < sizeof (MacRawDisk))
+        if (((size_t)dev->sector_size) < sizeof (MacRawDisk))
                 return 0;
 
 	void *label;
@@ -1335,7 +1335,7 @@ mac_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
 
 static int
 mac_partition_is_flag_available (
-	const PedPartition* part, PedPartitionFlag flag)
+	const PedPartition* part __attribute__((unused)), PedPartitionFlag flag)
 {
 	switch (flag) {
 	case PED_PARTITION_BOOT:
@@ -1586,7 +1586,7 @@ mac_get_max_primary_partition_count (const PedDisk* disk)
 }
 
 static bool
-mac_get_max_supported_partition_count (const PedDisk* disk, int *max_n)
+mac_get_max_supported_partition_count (const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = 65536;
 	return true;
diff --git a/libparted/labels/pc98.c b/libparted/labels/pc98.c
index ad13c0d..dad84d9 100644
--- a/libparted/labels/pc98.c
+++ b/libparted/labels/pc98.c
@@ -613,7 +613,7 @@ pc98_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
 
 static int
 pc98_partition_is_flag_available (
-	const PedPartition* part, PedPartitionFlag flag)
+	const PedPartition* part __attribute__((unused)), PedPartitionFlag flag)
 {
 	switch (flag) {
 	case PED_PARTITION_HIDDEN:
@@ -769,13 +769,13 @@ error:
 }
 
 static int
-pc98_get_max_primary_partition_count (const PedDisk* disk)
+pc98_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return MAX_PART_COUNT;
 }
 
 static bool
-pc98_get_max_supported_partition_count (const PedDisk* disk, int *max_n)
+pc98_get_max_supported_partition_count (const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = MAX_PART_COUNT;
 	return true;
diff --git a/libparted/labels/pt-tools.c b/libparted/labels/pt-tools.c
index 547b27c..fc698a4 100644
--- a/libparted/labels/pt-tools.c
+++ b/libparted/labels/pt-tools.c
@@ -40,7 +40,7 @@ static char zero[16 * 1024];
 int
 ptt_write_sector (PedDisk const *disk, void const *buf, size_t buflen)
 {
-  PED_ASSERT (buflen <= disk->dev->sector_size);
+  PED_ASSERT (buflen <= ((size_t) disk->dev->sector_size));
   /* Allocate a big enough buffer for ped_device_write.  */
   char *s0 = ped_malloc (disk->dev->sector_size);
   if (s0 == NULL)
@@ -88,7 +88,7 @@ ptt_read_sector (PedDevice const *dev, PedSector sector_num, void **buf)
 int
 ptt_clear_sectors (PedDevice *dev, PedSector start, PedSector n)
 {
-  PED_ASSERT (dev->sector_size <= sizeof zero);
+  PED_ASSERT (((size_t)dev->sector_size) <= sizeof zero);
   PedSector n_z_sectors = sizeof zero / dev->sector_size;
   PedSector n_full = n / n_z_sectors;
   PedSector i;
diff --git a/libparted/labels/rdb.c b/libparted/labels/rdb.c
index 4cf1463..5089595 100644
--- a/libparted/labels/rdb.c
+++ b/libparted/labels/rdb.c
@@ -970,7 +970,7 @@ amiga_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
 }
 
 static int
-amiga_partition_is_flag_available (const PedPartition* part,
+amiga_partition_is_flag_available (const PedPartition* part __attribute__((unused)),
 				 PedPartitionFlag flag)
 {
 	switch (flag) {
@@ -1112,13 +1112,13 @@ error:
 }
 
 static int
-amiga_get_max_primary_partition_count (const PedDisk* disk)
+amiga_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return AMIGA_MAX_PARTITIONS;
 }
 
 static bool
-amiga_get_max_supported_partition_count (const PedDisk* disk, int *max_n)
+amiga_get_max_supported_partition_count (const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = AMIGA_MAX_PARTITIONS;
 	return true;
diff --git a/libparted/labels/sun.c b/libparted/labels/sun.c
index 245208e..b76c46e 100644
--- a/libparted/labels/sun.c
+++ b/libparted/labels/sun.c
@@ -677,7 +677,7 @@ sun_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
 
 
 static int
-sun_partition_is_flag_available (const PedPartition* part,
+sun_partition_is_flag_available (const PedPartition* part __attribute__((unused)),
 				 PedPartitionFlag flag)
 {
 	switch (flag) {
@@ -693,14 +693,14 @@ sun_partition_is_flag_available (const PedPartition* part,
 }
 
 static bool
-sun_get_max_supported_partition_count (const PedDisk* disk, int *max_n)
+sun_get_max_supported_partition_count (const PedDisk* disk __attribute__((unused)), int *max_n)
 {
 	*max_n = SUN_DISK_MAXPARTITIONS;
 	return true;
 }
 
 static int
-sun_get_max_primary_partition_count (const PedDisk* disk)
+sun_get_max_primary_partition_count (const PedDisk* disk __attribute__((unused)))
 {
 	return SUN_DISK_MAXPARTITIONS;
 }
diff --git a/parted/parted.c b/parted/parted.c
index b20d432..d01329f 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -469,7 +469,7 @@ print_options_help ()
 }
 
 int
-do_help (PedDevice** dev)
+do_help (PedDevice** dev __attribute__((unused)))
 {
         if (command_line_get_word_count ()) {
                 char*   word = command_line_pop_word ();
@@ -887,7 +887,7 @@ partition_print_flags (PedPartition const *part)
 }
 
 static int
-partition_print (PedPartition* part)
+partition_print (PedPartition* part __attribute__((unused)))
 {
         return 1;
 }
@@ -1683,7 +1683,7 @@ do_toggle (PedDevice **dev)
 }
 
 static int
-do_unit (PedDevice** dev)
+do_unit (PedDevice** dev __attribute__((unused)))
 {
         PedUnit unit = ped_unit_get_default ();
         if (!command_line_get_unit (_("Unit?"), &unit))
diff --git a/parted/table.c b/parted/table.c
index 6c08fd1..4a31c4e 100644
--- a/parted/table.c
+++ b/parted/table.c
@@ -169,8 +169,9 @@ void table_add_row_from_strlist (Table* t, StrList* list)
 static void table_render_row (Table* t, int rownum, int ncols, wchar_t** s)
 {
         wchar_t** row = t->rows[rownum];
-        size_t len = 1, i;
+        size_t len = 1;
         size_t newsize;
+	int i;
 
         assert(t);
         assert(s != NULL);
diff --git a/parted/ui.c b/parted/ui.c
index 786deed..be93ea9 100644
--- a/parted/ui.c
+++ b/parted/ui.c
@@ -327,7 +327,7 @@ reset_env (int quit)
 
 /* Signal handler for SIGINT using 'sigaction'. */
 static void
-sa_sigint_handler (int signum, siginfo_t* info, void *ucontext)
+sa_sigint_handler (int signum __attribute__((unused)), siginfo_t* info, void *ucontext __attribute__((unused)))
 {
         if (info)
                 sigaction (SIGINT, &sig_int, NULL);
@@ -338,7 +338,7 @@ sa_sigint_handler (int signum, siginfo_t* info, void *ucontext)
 
 /* Signal handler for SIGSEGV using 'sigaction'. */
 static void
-sa_sigsegv_handler (int signum, siginfo_t* info, void* ucontext)
+sa_sigsegv_handler (int signum __attribute__((unused)), siginfo_t* info, void* ucontext __attribute__((unused)))
 {
         fprintf (stderr, bug_msg, VERSION);
         _dump_history ();
@@ -373,7 +373,7 @@ sa_sigsegv_handler (int signum, siginfo_t* info, void* ucontext)
 
 /* Signal handler for SIGFPE using 'sigaction'. */
 static void
-sa_sigfpe_handler (int signum, siginfo_t* info, void* ucontext)
+sa_sigfpe_handler (int signum __attribute__((unused)), siginfo_t* info, void* ucontext __attribute__((unused)))
 {
         fprintf (stderr, bug_msg, VERSION);
         _dump_history ();
@@ -437,7 +437,7 @@ sa_sigfpe_handler (int signum, siginfo_t* info, void* ucontext)
 
 /* Signal handler for SIGILL using 'sigaction'. */
 static void
-sa_sigill_handler (int signum, siginfo_t* info, void* ucontext)
+sa_sigill_handler (int signum __attribute__((unused)), siginfo_t* info, void* ucontext __attribute__((unused)))
 {
         fprintf (stderr, bug_msg, VERSION);
         _dump_history ();
-- 
1.7.8.2





Information forwarded to bug-parted <at> gnu.org:
bug#16053; Package parted. (Fri, 13 Dec 2013 21:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 16053 <at> debbugs.gnu.org (full text, mbox):

From: Phillip Susi <psusi <at> ubuntu.com>
To: Doron Tsur <doront <at> mellanox.com>, 16053 <at> debbugs.gnu.org
Cc: itaib <at> mellanox.com
Subject: Re: bug#16053: [PATCH 1/2] "-Wall -Wextra -Werror" compilation patches
 - part 1/2
Date: Fri, 13 Dec 2013 16:42:30 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That seems like an awful lot of changes that makes the code less
readable to undo the double super dooper pedantic warnings are errors
setting.  Why bother?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSq39GAAoJEI5FoCIzSKrwBaYH/A8WEnY+CWOwZMxgPVRzliu3
bBxndlOLkfrggxNPvt5UNLkV6MSeIPQN6ZvdfQvKS1805WwYnFsbabk/PyqotDuE
nR04qLqkF7lY8Mlpqj+JbTnW0b7/AByWfJFO4NFrvuIxwPEZ5V+njiLiT6jmawC0
Ff8T5V31cDzyZDCkYD0TDjAfdIaK2KtJfl7NBQVd10zXVKgJe6bsWwQ0nYvg1/Id
6AgmkbUkN2U+72YC1ucy+I0bhA2AeZcOWBbfk/AqnpqR1ySOJTUkVXpyAiNYKvB3
yxFsdZ5eOjczvHGmvu6E4brNDINq6pqlzcjjv79lMENpnUTH7bw+s1dK49f3oqs=
=gNrG
-----END PGP SIGNATURE-----




Information forwarded to bug-parted <at> gnu.org:
bug#16053; Package parted. (Mon, 16 Dec 2013 04:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 16053 <at> debbugs.gnu.org (full text, mbox):

From: Doron Tsur <doront <at> mellanox.com>
To: Phillip Susi <psusi <at> ubuntu.com>, "16053 <at> debbugs.gnu.org"
 <16053 <at> debbugs.gnu.org>
Cc: Itai Baz <itaib <at> mellanox.com>
Subject: RE: bug#16053: [PATCH 1/2] "-Wall -Wextra -Werror" compilation
 patches - part 1/2
Date: Mon, 16 Dec 2013 04:39:02 +0000
It should allow users to check new code and possible grub extension in a pedantic manner easily.


-----Original Message-----
From: Phillip Susi [mailto:psusi <at> ubuntu.com] 
Sent: Friday, December 13, 2013 11:43 PM
To: Doron Tsur; 16053 <at> debbugs.gnu.org
Cc: Itai Baz
Subject: Re: bug#16053: [PATCH 1/2] "-Wall -Wextra -Werror" compilation patches - part 1/2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That seems like an awful lot of changes that makes the code less readable to undo the double super dooper pedantic warnings are errors setting.  Why bother?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSq39GAAoJEI5FoCIzSKrwBaYH/A8WEnY+CWOwZMxgPVRzliu3
bBxndlOLkfrggxNPvt5UNLkV6MSeIPQN6ZvdfQvKS1805WwYnFsbabk/PyqotDuE
nR04qLqkF7lY8Mlpqj+JbTnW0b7/AByWfJFO4NFrvuIxwPEZ5V+njiLiT6jmawC0
Ff8T5V31cDzyZDCkYD0TDjAfdIaK2KtJfl7NBQVd10zXVKgJe6bsWwQ0nYvg1/Id
6AgmkbUkN2U+72YC1ucy+I0bhA2AeZcOWBbfk/AqnpqR1ySOJTUkVXpyAiNYKvB3
yxFsdZ5eOjczvHGmvu6E4brNDINq6pqlzcjjv79lMENpnUTH7bw+s1dK49f3oqs=
=gNrG
-----END PGP SIGNATURE-----




Information forwarded to bug-parted <at> gnu.org:
bug#16053; Package parted. (Mon, 16 Dec 2013 14:18:02 GMT) Full text and rfc822 format available.

Message #14 received at 16053 <at> debbugs.gnu.org (full text, mbox):

From: Phillip Susi <psusi <at> ubuntu.com>
To: Doron Tsur <doront <at> mellanox.com>, 
 "16053 <at> debbugs.gnu.org" <16053 <at> debbugs.gnu.org>
Cc: Itai Baz <itaib <at> mellanox.com>
Subject: Re: bug#16053: [PATCH 1/2] "-Wall -Wextra -Werror" compilation patches
 - part 1/2
Date: Mon, 16 Dec 2013 09:17:31 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/15/2013 11:39 PM, Doron Tsur wrote:
> It should allow users to check new code and possible grub extension
> in a pedantic manner easily.

If you want to compile new code with -Wextra, that could be a nice
check I suppose, but I don't think the whole code base needs to
compile with -Wextra + -Werror, especially if it means making the code
less readable.  I believe the reason there is a -Wextra is because
those warnings are considered so silly and annoying to code around
that they aren't wanted for -Wall -Werror.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSrwt7AAoJEI5FoCIzSKrw3tAH/2bECOPQmS2PSjSNmGUcE1oh
L3xoIZFajjnEQafVjp8kROK3dYb84OCZq0Fq8ECSrQMq3w/AGHAdzeE3aAB0ENjY
rZEWbbZ3dNbq0oNZg8GNsUQybNt820X2oFHf6JL6z6OKImWXgMUZRtMaRYrmbajg
3UJq0YXHA63NnkpZ2zZcLuEcLDRr4AOFp5IUEGipHtF93EJ9DS8cViUQx1rrjirv
bnyuYp22/z/NtlGXER/V0O2r4svNH8U1rw5nTEeDC7rKYOTmtu0XXDmQzQ26+oG4
aGRXO88IG7Sqm9EB1yWIN1K1uRqxSK7BI4Fam6lTmewxYAVf4km5TehMYC/6ZoA=
=WgS/
-----END PGP SIGNATURE-----




Information forwarded to bug-parted <at> gnu.org:
bug#16053; Package parted. (Mon, 16 Dec 2013 15:33:01 GMT) Full text and rfc822 format available.

Message #17 received at 16053 <at> debbugs.gnu.org (full text, mbox):

From: Doron Tsur <doront <at> mellanox.com>
To: Phillip Susi <psusi <at> ubuntu.com>, "16053 <at> debbugs.gnu.org"
 <16053 <at> debbugs.gnu.org>
Cc: Itai Baz <itaib <at> mellanox.com>
Subject: RE: bug#16053: [PATCH 1/2] "-Wall -Wextra -Werror" compilation
 patches - part 1/2
Date: Mon, 16 Dec 2013 15:32:55 +0000
I personally prefer code compiled with Wextra, but I guess it is open for discussion,

You have my patch available in case you wish to inherit changes from there.


-----Original Message-----
From: Phillip Susi [mailto:psusi <at> ubuntu.com] 
Sent: Monday, December 16, 2013 4:18 PM
To: Doron Tsur; 16053 <at> debbugs.gnu.org
Cc: Itai Baz
Subject: Re: bug#16053: [PATCH 1/2] "-Wall -Wextra -Werror" compilation patches - part 1/2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/15/2013 11:39 PM, Doron Tsur wrote:
> It should allow users to check new code and possible grub extension in 
> a pedantic manner easily.

If you want to compile new code with -Wextra, that could be a nice check I suppose, but I don't think the whole code base needs to compile with -Wextra + -Werror, especially if it means making the code less readable.  I believe the reason there is a -Wextra is because those warnings are considered so silly and annoying to code around that they aren't wanted for -Wall -Werror.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSrwt7AAoJEI5FoCIzSKrw3tAH/2bECOPQmS2PSjSNmGUcE1oh
L3xoIZFajjnEQafVjp8kROK3dYb84OCZq0Fq8ECSrQMq3w/AGHAdzeE3aAB0ENjY
rZEWbbZ3dNbq0oNZg8GNsUQybNt820X2oFHf6JL6z6OKImWXgMUZRtMaRYrmbajg
3UJq0YXHA63NnkpZ2zZcLuEcLDRr4AOFp5IUEGipHtF93EJ9DS8cViUQx1rrjirv
bnyuYp22/z/NtlGXER/V0O2r4svNH8U1rw5nTEeDC7rKYOTmtu0XXDmQzQ26+oG4
aGRXO88IG7Sqm9EB1yWIN1K1uRqxSK7BI4Fam6lTmewxYAVf4km5TehMYC/6ZoA=
=WgS/
-----END PGP SIGNATURE-----




This bug report was last modified 11 years and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.