Package: libneo4j-client
Version: 1.1.0-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package libneo4j-client FTBFS on multiple architectures (armel, armhf, hppa,
mips, mipsel and powerpcspe) with following error:
result_stream.c: In function 'run_result_field':
result_stream.c:583:37: error: cast increases required alignment of target type 
[-Werror=cast-align]
     const result_record_t *record = (const result_record_t *)self;
                                     ^

build logs:
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client&arch=armel&ver=1.1.0-1&stamp=1469106786
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client&arch=armhf&ver=1.1.0-1&stamp=1469106957
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client&arch=hppa&ver=1.1.0-1&stamp=1469109462
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client&arch=mips&ver=1.1.0-1&stamp=1469107053
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client&arch=mipsel&ver=1.1.0-1&stamp=1469106870
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client&arch=powerpcspe&ver=1.1.0-1&stamp=1469569233

The attached patch fixes the alignment issue by replacing type casting with
container_of() macro.

With this patch I was able to build opensips successfully for mips and mipsel.
It may fix the build for other architectures too.

Regards,
Daniel
--- libneo4j-client-1.1.0.orig/src/lib/result_stream.c
+++ libneo4j-client-1.1.0/src/lib/result_stream.c
@@ -580,7 +580,8 @@ int run_rs_close(neo4j_result_stream_t *
 neo4j_value_t run_result_field(const neo4j_result_t *self,
         unsigned int index)
 {
-    const result_record_t *record = (const result_record_t *)self;
+    const result_record_t *record = container_of(self,
+            result_record_t, _result);
     REQUIRE(record != NULL, neo4j_null);
     return neo4j_list_get(record->list, index);
 }

Reply via email to