From: Kamalesh Babulal Date: Tue, 12 Sep 2023 02:45:00 +0000 (+0530) Subject: gunit/001: fix sign compare build warning X-Git-Tag: v3.2.0~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c472966bc8e284d0c01b5db6df7ca484dcb43708;p=thirdparty%2Flibcgroup.git gunit/001: fix sign compare build warning 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 --- 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; }