From cfe5beb7b7f8fa007c1bf8e9aa6decb486adfe38 Mon Sep 17 00:00:00 2001 From: Eric Sheng Date: Wed, 13 Apr 2022 08:13:06 -0700 Subject: [PATCH] [#12150] docdb: Fix gcc9 compile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: gcc9 compile currently fails with the following: ``` /------------------------------------------------------------------------------- | COMPILATION FAILED |------------------------------------------------------------------------------- ent/src/yb/tools/yb-admin-test_ent.cc: In member function ‘virtual void yb::tools::XClusterAdminCliTest_Large_TestBootstrapProducerPerformance_Test::TestBody()’: ent/src/yb/tools/yb-admin-test_ent.cc:1374:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare] 1374 | for (int i = 1; i < tables.size(); ++i) { | ~~^~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors Input files: src/yb/tools/CMakeFiles/yb-admin-test_ent.dir/__/__/__/ent/src/yb/tools/yb-admin-test_ent.cc.o ent/src/yb/tools/yb-admin-test_ent.cc Output file (from -o): src/yb/tools/CMakeFiles/yb-admin-test_ent.dir/__/__/__/ent/src/yb/tools/yb-admin-test_ent.cc.o \------------------------------------------------------------------------------- ``` This diff fixes the compile error. Test Plan: Jenkins: compile only Reviewers: sergei, bogdan, nicolas Reviewed By: nicolas Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D16521 --- ent/src/yb/tools/yb-admin-test_ent.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ent/src/yb/tools/yb-admin-test_ent.cc b/ent/src/yb/tools/yb-admin-test_ent.cc index b2bb15f0f822..31f0fa2a293b 100644 --- a/ent/src/yb/tools/yb-admin-test_ent.cc +++ b/ent/src/yb/tools/yb-admin-test_ent.cc @@ -1371,7 +1371,7 @@ TEST_F(XClusterAdminCliTest_Large, TestBootstrapProducerPerformance) { } std::string table_ids = tables.at(0)->id(); - for (int i = 1; i < tables.size(); ++i) { + for (size_t i = 1; i < tables.size(); ++i) { table_ids += "," + tables.at(i)->id(); }