UDisks git: GCC 4.5 warning case value ‘4294967295’ not in enumerated type ‘PartitionScheme’
Marti Raudsepp
marti at juffo.org
Wed May 19 12:03:29 PDT 2010
Hi list,
When building the current UDisks version from git I get the following error:
make[4]: Entering directory
`/usr/src/builds/udisks-git/src/udisks-build/src/helpers'
[...]
cc1: warnings being treated as errors
partutil.c: In function ‘part_add_change_partition’:
partutil.c:1459:5: error: case value ‘4294967295’ not in enumerated
type ‘PartitionScheme’
The fix (below) is quite simple, but I don't know if it's the right
way to go about this... Adding PART_TYPE_UNKNOWN to the enumeration
seemed like an overkill for this one-off case.
Regards,
Marti
---
partutil.c: Avoid GCC 4.5 warning with 'case -1' statement on enum type.
Before this, GCC 4.5.0 reported the following error:
partutil.c:1459:5: error: case value ‘4294967295’ not in enumerated
type ‘PartitionScheme’
diff --git a/src/helpers/partutil.c b/src/helpers/partutil.c
--- a/src/helpers/partutil.c
+++ b/src/helpers/partutil.c
@@ -1454,7 +1454,7 @@
}
/* now that we know the partitoning scheme, sanity check type and flags */
- switch (scheme)
+ switch ((int) scheme)
{
case -1:
/* unknown partition table format; error out if any type, label
or flags are given */
More information about the devkit-devel
mailing list