Skip to content

Commit c236ea0

Browse files
author
Huang-Ming Huang
committed
fix g++ 4.9 strict alias warning
1 parent d8d5a65 commit c236ea0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mfast/coder/encoder/fast_encoder.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ struct fast_encoder_impl : simple_template_repo_t {
5050
}
5151

5252
void visit(enum_cref cref) {
53-
this->visit(reinterpret_cast<uint64_cref &>(cref));
53+
uint64_cref tmp;
54+
std::memcpy(&tmp, &cref, sizeof(cref));
55+
this->visit(tmp);
5456
}
5557

5658
template <typename SimpleCRef> void visit(SimpleCRef cref);

0 commit comments

Comments
 (0)