Skip to content

Commit 0601de2

Browse files
Removed warning test_qos (#2859) (#2945)
(cherry picked from commit df3a303) Signed-off-by: Alejandro Hernandez Cordero <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]>
1 parent de7f83c commit 0601de2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rclcpp/test/rclcpp/test_qos.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ TEST(TestQoS, from_rmw_validity)
264264
{
265265
rmw_qos_profile_t invalid_qos;
266266
memset(&invalid_qos, 0, sizeof(invalid_qos));
267-
reinterpret_cast<uint32_t &>(invalid_qos.history) = 999;
267+
unsigned int n = 999;
268+
memcpy(&invalid_qos.history, &n, sizeof(n));
268269

269270
EXPECT_THROW({
270271
rclcpp::QoSInitialization::from_rmw(invalid_qos);

0 commit comments

Comments
 (0)