Bug#1083059: hfsplus: FTBFS with gcc-14
Package: hfsplus
Version: 1.0.4-17.1ubuntu1
Severity: normal
Tags: ftbfs
X-Debbugs-Cc: daniel.bungert@canonical.com
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu oracular
Dear Maintainer,
This bug report was also filed in Ubuntu and can be found at
https://launchpad.net/bugs/2083086
hfsplus is FTBFS with gcc-14 on presumably all BIG_ENDIAN arches.
https://launchpadlibrarian.net/749243763/buildlog_ubuntu-oracular-s390x.hfsplus_1.0.4-17.1build1_BUILDING.txt.gz
I have only observed this on s390x on Ubuntu and assume it would also apply to
Debian.
In file included from partitions.c:29:
partitions.c: In function ‘partition_fillstruct’:
swab.h:51:51: error: assignment to ‘char *’ from incompatible pointer type
‘UInt16 *’ {aka ‘short unsigned int *’} [-Wincompatible-pointer-types]
51 | #define bswabU16_inc(ptr) *((UInt16*) (ptr)); ptr = (UInt16*)ptr + 1
| ^
partitions.c:59:23: note: in expansion of macro ‘bswabU16_inc’
59 | p->pmSig = bswabU16_inc( buf);
| ^~~~~~~~~~~~
this continues for all the bswabUXX_inc in partition_fillstruct.
I addressed this for Ubuntu (mostly) as follows:
--- a/libhfsp/src/swab.h
+++ b/libhfsp/src/swab.h
@@ -48,25 +48,25 @@
#define bswabU16(val) val
-#define bswabU16_inc(ptr) *((UInt16*) (ptr)); ptr = (UInt16*)ptr + 1
+#define bswabU16_inc(ptr) *((UInt16*) (ptr)); ptr = (void *)((UInt16*)ptr + 1)
/* Only available as a GCC extension, but required on sparc due to
alignment issues in some of the on-disk structs */
#if defined(__GNUC__) && defined(__sparc__)
#define bswabU32_inc(ptr) ({ \
unsigned char *c = (char*)ptr; \
- ptr = ((UInt32 *)ptr) + 1; \
+ ptr = (void *)(((UInt32 *)ptr) + 1); \
((c[0] << 24)+(c[1] << 16)+(c[2] << 8)+c[3]);})
#define bswabU64_inc(ptr) ({ \
unsigned char *c = (char*)ptr; \
UInt64 val = 0; \
int i = 0; \
- ptr = ((UInt64 *)ptr) + 1; \
+ ptr = (void *)(((UInt64 *)ptr) + 1); \
while (i < 8) \
val += (c[i] << (8*(7-i++))); \
val;})
#else
-#define bswabU32_inc(ptr) *((UInt32*) (ptr)); ptr = (UInt32*)ptr + 1
-#define bswabU64_inc(ptr) *((UInt64*) (ptr)); ptr = (UInt64*)ptr + 1
+#define bswabU32_inc(ptr) *((UInt32*) (ptr)); ptr = (void *)((UInt32*)ptr + 1)
+#define bswabU64_inc(ptr) *((UInt64*) (ptr)); ptr = (void *)((UInt64*)ptr + 1)
#endif
#define bstoreU16_inc(ptr, val) *((UInt16*) (ptr)) = val; ptr = (void*)((UInt16*)ptr + 1)
The Ubuntu version I uploaded is different because of a flaw on the
defined(__sparc__) path that Ubuntu won't use, I expect the above is corret.
-Dan
Reply to: