From: Matt Benjamin Date: Thu, 29 May 2014 14:34:20 +0000 (-0400) Subject: Work around an apparent binding bug (GCC 4.8). X-Git-Tag: v0.80.6~44 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae787cfa88dfd0f5add5932b297258c46af4e333;p=ceph.git Work around an apparent binding bug (GCC 4.8). A reference to h->seq passed to std::pair ostensibly could not bind because the header structure is packed. At first this looked like a more general unaligned access problem, but the only location the compiler rejects is a false positive. Signed-off-by: Matt Benjamin (cherry picked from commit c930a1f119069a424af28a618b0abff4947c221f) --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index c6bd6167aaa4..7eb7927e0412 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -1758,7 +1758,12 @@ FileJournal::read_entry_result FileJournal::do_read_entry( // ok! if (seq) *seq = h->seq; - journalq.push_back(pair(h->seq, pos)); + + // works around an apparent GCC 4.8(?) compiler bug about unaligned + // bind by reference to (packed) h->seq + journalq.push_back( + pair(static_cast(h->seq), + static_cast(pos))); if (next_pos) *next_pos = pos;