Merge lp:~michihenning/unity-scopes-api/fix-arm-build-warning into lp:unity-scopes-api

Proposed by Michi Henning
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 304
Merged at revision: 308
Proposed branch: lp:~michihenning/unity-scopes-api/fix-arm-build-warning
Merge into: lp:unity-scopes-api
Diff against target: 22 lines (+5/-3)
1 file modified
src/scopes/internal/zmq_middleware/ZmqReceiver.cpp (+5/-3)
To merge this branch: bzr merge lp:~michihenning/unity-scopes-api/fix-arm-build-warning
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+249150@code.launchpad.net

Commit message

Suppressed warning for arm build and updated comment regarding alignment.

Description of the change

Suppressed warning for arm build and updated comment regarding alignment.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/internal/zmq_middleware/ZmqReceiver.cpp'
2--- src/scopes/internal/zmq_middleware/ZmqReceiver.cpp 2014-01-07 12:22:29 +0000
3+++ src/scopes/internal/zmq_middleware/ZmqReceiver.cpp 2015-02-10 05:31:32 +0000
4@@ -71,13 +71,15 @@
5 if (reinterpret_cast<uintptr_t>(buf) % sizeof(capnp::word) == 0)
6 {
7 // String buffer is word-aligned, point directly at the start of the string.
8+#pragma GCC diagnostic push
9+#pragma GCC diagnostic ignored "-Wcast-align"
10 segments_.push_back(kj::ArrayPtr<capnp::word const>(reinterpret_cast<capnp::word const*>(buf), num_words));
11+#pragma GCC diagnostic pop
12 }
13 else
14 {
15- // No coverage here because std::string appears to always have its buffer word-aligned.
16- // Because the standard doesn't guarantee this though, and it might change in the future,
17- // the code below remains enabled.
18+ // No coverage here because, on amd64, std::string has its buffer word-aligned but,
19+ // on armhf, capnp::word is 8-byte aligned and the string buffer is 4-byte aligned.
20 //
21 // String buffer is not word-aligned, make a copy and point at that.
22 unique_ptr<capnp::word[]> words(new capnp::word[num_words]); // LCOV_EXCL_LINE

Subscribers

People subscribed via source and target branches

to all changes: