Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] fix break strict-aliasing rules warnings in get_table_tests.cpp #635

Merged
merged 4 commits into from
Jul 12, 2022

Conversation

linh2931
Copy link
Member

@linh2931 linh2931 commented Jul 9, 2022

Resolved #631.

Fixed following warnings:

.../tests/get_table_tests.cpp: In member function ‘void get_table_tests::get_table_next_key_test::test_method()’:
.../tests/get_table_tests.cpp:584:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  584 |    BOOST_CHECK(*reinterpret_cast<float64_t*>(&secdouble_res_value) == secdouble_expected_value);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../tests/get_table_tests.cpp:591:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  591 |    BOOST_CHECK(*reinterpret_cast<float64_t*>(&more2_secdouble_res_value) == more2_secdouble_expected_value);/home/lh/work/warning/tests/get_table_tests.cpp: In member function ‘void get_table_tests::get_table_next_key_test::test_method()’:
.../tests/get_table_tests.cpp:584:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  584 |    BOOST_CHECK(*reinterpret_cast<float64_t*>(&secdouble_res_value) == secdouble_expected_value);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../tests/get_table_tests.cpp:591:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  591 |    BOOST_CHECK(*reinterpret_cast<float64_t*>(&more2_secdouble_res_value) == more2_secdouble_expected_value);

@linh2931 linh2931 requested review from heifner and spoonincode July 9, 2022 23:42
@linh2931 linh2931 self-assigned this Jul 9, 2022
@linh2931 linh2931 merged commit 5e9a867 into main Jul 12, 2022
@linh2931 linh2931 deleted the fix-strict-aliasing branch July 12, 2022 11:56
@linh2931 linh2931 restored the fix-strict-aliasing branch July 12, 2022 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

break strict-aliasing rules warnings in get_table_tests.cpp
2 participants