Skip to content

Fix protobuf version (< 3.4.0) compatibility for ByteSizeLong() and SpaceUsedLong()#3292

Merged
wwbmmm merged 1 commit into
apache:masterfrom
chenBright:fix_pb_byte_size
May 11, 2026
Merged

Fix protobuf version (< 3.4.0) compatibility for ByteSizeLong() and SpaceUsedLong()#3292
wwbmmm merged 1 commit into
apache:masterfrom
chenBright:fix_pb_byte_size

Conversation

@chenBright
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: resolve

Problem Summary:

The project fails to compile with protobuf versions < 3.4.0. The ByteSizeLong() and SpaceUsedLong() methods were introduced in protobuf 3.4.0, but the code unconditionally uses them with the override keyword, causing compilation errors:

  • 'size_t brpc::NonreflectableMessage<T>::SpaceUsedLong() const' marked 'override', but does not override
  • 'size_t brpc::NonreflectableMessage<T>::ByteSizeLong() const' marked 'override', but does not override

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:

  • Breaking backward compatibility:


Check List:

@wwbmmm wwbmmm merged commit 654ae77 into apache:master May 11, 2026
17 checks passed
@chenBright chenBright deleted the fix_pb_byte_size branch May 11, 2026 12:06
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.

2 participants