From c472966bc8e284d0c01b5db6df7ca484dcb43708 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Tue, 12 Sep 2023 08:15:00 +0530 Subject: [PATCH] gunit/001: fix sign compare build warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix the following sign compare build warning: In file included from 001-path.cpp:9: ../../googletest/googletest/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperLT(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]’: 001-path.cpp:53:4: required from here ../../googletest/googletest/include/gtest/gtest.h:1526:28: warning: comparison of integer expressions of different signedness: ‘const int’ and ‘const long unsigned int’ [-Wsign-compare] ../../googletest/googletest/include/gtest/gtest.h:1510:7: if (val1 op val2) {\ ~~~~~~~~~~~~ ../../googletest/googletest/include/gtest/gtest.h:1526:28: GTEST_IMPL_CMP_HELPER_(LT, <); ../../googletest/googletest/include/gtest/gtest.h:1510:12: note: in definition of macro ‘GTEST_IMPL_CMP_HELPER_’ if (val1 op val2) {\ ^~ Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- tests/gunit/001-path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gunit/001-path.cpp b/tests/gunit/001-path.cpp index d95e1ad1..b48f06e6 100644 --- a/tests/gunit/001-path.cpp +++ b/tests/gunit/001-path.cpp @@ -50,7 +50,7 @@ class BuildPathV1Test : public ::testing::Test { ret = snprintf(cg_mount_table[i].mount.path, FILENAME_MAX, "/sys/fs/cgroup/%s", cg_mount_table[i].name); - ASSERT_LT(ret, sizeof(cg_mount_table[i].mount.path)); + ASSERT_LT(ret, (int)sizeof(cg_mount_table[i].mount.path)); cg_mount_table[i].mount.next = NULL; } -- 2.47.2