Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#23858] build: fix ./yb_build.sh release --gcc11
Summary: Fix various compilation issues with this build configuration: ybtidbitmap.h: ../../../../../../../src/postgres/src/include/nodes/ybtidbitmap.h:49:9: error: ‘unused’ attribute ignored [-Werror=attributes] 49 | YbTBMIteratingState iterating PG_USED_FOR_ASSERTS_ONLY; | ^~~~~~~~~~~~~~~~~~~ pg_client_session.cc: ../../src/yb/common/schema.h: In member function ‘yb::Status yb::tserver::PgClientSession::AlterTable(const yb::tserver::PgAlterTableRequestPB&, yb::tserver::PgAlterTableResponsePB*, yb::rpc::RpcContext*)’: ../../src/yb/common/schema.h:475:28: error: ‘replica_identity’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 475 | ysql_replica_identity_ = replica_identity; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ../../src/yb/tserver/pg_client_session.cc:818:23: note: ‘replica_identity’ was declared here 818 | PgReplicaIdentity replica_identity; | ^~~~~~~~~~~~~~~~ cron.c: ../../src/odyssey/sources/cron.c: In function ‘od_cron_stat_cb’: ../../src/odyssey/sources/cron.c:67:25: error: ‘strncpy’ specified bound 64 equals destination size [-Werror=stringop-truncation] 67 | strncpy(instance->yb_stats[index].user_name, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | route->id.user, USER_NAME_MAX_LEN); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/odyssey/sources/cron.c:67:25: error: ‘strncpy’ specified bound 64 equals destination size [-Werror=stringop-truncation] ../../src/odyssey/sources/cron.c:67:25: error: ‘strncpy’ specified bound 64 equals destination size [-Werror=stringop-truncation] yb-admin-snapshot-schedule-test.cc: ../../src/yb/tools/yb-admin-snapshot-schedule-test.cc: In lambda function: ../../src/yb/tools/yb-admin-snapshot-schedule-test.cc:269:56: error: ‘state’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 269 | return state == master::SysCloneStatePB::ABORTED || | ^~ In file included from ../../src/yb/util/result.h:23, from ../../src/yb/util/enums.h:32, from ../../src/yb/cdc/cdc_types.h:25, from ../../src/yb/client/client_fwd.h:26, from ../../src/yb/tools/yb-admin-snapshot-schedule-test.cc:24: ../../src/yb/tools/yb-admin-snapshot-schedule-test.cc:266:38: note: ‘state’ was declared here 266 | master::SysCloneStatePB::State state; | ^~~~~ The cron.c change is an improvement. The ybtidbitmap.h change is not desirable (it should be reverted if future compiler versions are smarter). The remaining changes are not logically necessary either, but they had to be changed because this build configuration complains. Jira: DB-12765 Test Plan: ./yb_build.sh release --gcc11 Close: #23858 Jenkins: compile only Reviewers: telgersma Reviewed By: telgersma Subscribers: telgersma, yql, ybase Differential Revision: https://phorge.dev.yugabyte.com/D37829
- Loading branch information