[
https://issues.apache.org/jira/browse/QPID-5129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13764589#comment-13764589
]
Kim van der Riet commented on QPID-5129:
----------------------------------------
Breaking down the first of the above statements into
{code}
char* cp = (char*)rptr + rd_cnt;
u_int64_t* ip = (u_int64_t*)cp;
_deq_hdr._deq_rid = *ip;
{code}
shows that the error occurs in the middle line.
The following allows this to compile:
{code}
_deq_hdr._deq_rid = *(u_int64_t*)(void*)((char*)rptr + rd_cnt);
{code}
but this feels wrong. Could casting through void* may be defeating memory
alignment checks that are significant?
> Legacy store fails to compile on ARM due to alignment issues
> ------------------------------------------------------------
>
> Key: QPID-5129
> URL: https://issues.apache.org/jira/browse/QPID-5129
> Project: Qpid
> Issue Type: Bug
> Components: C++ Broker
> Affects Versions: 0.24
> Reporter: Darryl L. Pierce
> Assignee: Kim van der Riet
> Priority: Blocker
>
> When compiling on ARM (ARM hfp) the following occurs:
> {noformat}
> [ 85%] Building CXX object
> src/CMakeFiles/legacystore.dir/qpid/legacystore/jrnl/deq_rec.o
> cd /builddir/build/BUILD/qpid-0.24/cpp/src && /usr/bin/c++
> -DXQ_EFFECTIVE_BOOLEAN_VALUE_HPP -D_IN_QPID_BROKER -Dlegacystore_EXPORTS -O2
> -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
> --param=ssp-buffer-size=4 -grecord-gcc-switches -march=armv7-a
> -mfpu=vfpv3-d16 -mfloat-abi=hard -fvisibility-inlines-hidden -Werror
> -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align
> -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers
> -Woverloaded-virtual -fPIC -I/builddir/build/BUILD/qpid-0.24/cpp/src
> -I/builddir/build/BUILD/qpid-0.24/cpp/src/../include
> -I/builddir/build/BUILD/qpid-0.24/cpp/src/qpid/legacystore -pthread -o
> CMakeFiles/legacystore.dir/qpid/legacystore/jrnl/deq_rec.o -c
> /builddir/build/BUILD/qpid-0.24/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp
> /builddir/build/BUILD/qpid-0.24/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp: In
> member function 'virtual u_int32_t
> mrg::journal::deq_rec::decode(mrg::journal::rec_hdr&, void*, u_int32_t,
> u_int32_t)':
> /builddir/build/BUILD/qpid-0.24/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp:273:63:
> error: cast from 'char*' to 'u_int64_t* {aka long long unsigned int*}'
> increases required alignment of target type [-Werror=cast-align]
> _deq_hdr._deq_rid = *(u_int64_t*)((char*)rptr + rd_cnt);
> ^
> /builddir/build/BUILD/qpid-0.24/cpp/src/qpid/legacystore/jrnl/deq_rec.cpp:278:65:
> error: cast from 'char*' to 'std::size_t* {aka unsigned int*}' increases
> required alignment of target type [-Werror=cast-align]
> _deq_hdr._xidsize = *(std::size_t*)((char*)rptr + rd_cnt);
> ^
> cc1plus: all warnings being treated as errors
> make[2]: Leaving directory `/builddir/build/BUILD/qpid-0.24/cpp'
> make[2]: *** [src/CMakeFiles/legacystore.dir/qpid/legacystore/jrnl/deq_rec.o]
> Error 1
> make[1]: *** [src/CMakeFiles/legacystore.dir/all] Error 2
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]