Skip to content

fix(build): clean up redundant warning sources#3385

Open
darion-yaphet wants to merge 2 commits into
apache:masterfrom
darion-yaphet:fix-compile-warnings
Open

fix(build): clean up redundant warning sources#3385
darion-yaphet wants to merge 2 commits into
apache:masterfrom
darion-yaphet:fix-compile-warnings

Conversation

@darion-yaphet

Copy link
Copy Markdown
Contributor

• Remove redundant pthread linkage from protoc-gen-mcpack targets and quiet compiler warnings from unused rpcz/couchbase code paths and non-x86 iobuf builds.

What problem does this PR solve?

Issue Number: resolve

Problem Summary:
This PR cleans up redundant build configuration and compiler warning sources. protoc-gen-mcpack already links through the configured dynamic/static brpc target and
dynamic libraries, so the explicit pthread linkage is unnecessary. A few warning-only code paths also produced noise from unused rpcz/couchbase symbols and the non-
x86 iobuf fallback warning.

What is changed and the side effects?

Changed:

  • Removed explicit pthread linkage from protoc-gen-mcpack CMake targets.
  • Removed an unused span_type_str block from rpcz annotation printing.
  • Marked DEFAULT_VBUCKET_COUNT as [[maybe_unused]].
  • Removed the non-x86_64 #warning from iobuf fallback code.
  • Ensured src/brpc/couchbase.cpp ends with a newline.

Side effects:

  • Performance effects: None expected.
  • Breaking backward compatibility: None expected.

Check List:

Remove redundant pthread linkage from protoc-gen-mcpack targets and quiet compiler warnings from unused rpcz/couchbase code paths and non-x86 iobuf builds.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces build-time noise by removing redundant link dependencies and eliminating warning-producing but otherwise unused/legacy code paths in core brpc utilities and builtins.

Changes:

  • Remove explicit pthread linkage from protoc-gen-mcpack CMake targets (relying on existing thread linkage via common libraries).
  • Remove warning-only / unused code that triggered compiler diagnostics in rpcz and non-x86_64 iobuf fallback paths.
  • Silence an unused Couchbase constant and fix file formatting (newline at EOF).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/CMakeLists.txt Drops redundant pthread linkage from protoc-gen-mcpack targets.
src/butil/iobuf.cpp Removes a non-x86_64 #warning to quiet builds.
src/brpc/couchbase.cpp Marks an unused constant as unused and normalizes EOF newline.
src/brpc/builtin/rpcz_service.cpp Removes an unused span-type string block to avoid unused-variable warnings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/brpc/couchbase.cpp Outdated
Comment on lines 48 to 50
[[maybe_unused]] constexpr uint32_t APPLE_VBUCKET_COUNT = 64;
constexpr uint32_t DEFAULT_VBUCKET_COUNT = 1024;
[[maybe_unused]] constexpr uint32_t DEFAULT_VBUCKET_COUNT = 1024;
constexpr int CONNECTION_ID_SIZE = 33;
Use brpc's existing ALLOW_UNUSED macro on Couchbase vbucket constants so the declarations keep silencing platform-specific unused-constant warnings without requiring C++17 attributes.
@wwbmmm

wwbmmm commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants