Skip to content

Fix build with OpenSSL 4.0 - #548

Merged
fcostaoliveira merged 1 commit into
redis:masterfrom
collinfunk:fix-openssl-4-build
Oct 6, 2026
Merged

fcostaoliveira merged 1 commit into
redis:masterfrom
collinfunk:fix-openssl-4-build

Conversation

@collinfunk

@collinfunk collinfunk commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The build will fail with the following undeclared identifier error:

memtier_benchmark.cpp:2133:18: error: use of undeclared identifier 'bitmask_is_contiguous'
 2133 |             if (!bitmask_is_contiguous(cfg->tls_protocols)) {
      |                  ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

We can fix this by declaring it before it is used.


Note

Low Risk
Compile-order fix only; no change to TLS validation logic beyond making OpenSSL 4.0 builds succeed.

Overview
Fixes OpenSSL 4.0 builds where memtier_benchmark.cpp failed to compile because bitmask_is_contiguous was used in --tls-protocols parsing before its definition (which lives much later in the file).

Adds a #if OPENSSL_VERSION_NUMBER >= 0x40000000L forward declaration next to the existing TLS protocol defaults so the OpenSSL 4.0-only validation (rejecting non-contiguous protocol bitmasks when per-version disable flags are gone) can compile without changing runtime behavior.

Reviewed by Cursor Bugbot for commit c035b33. Bugbot is set up for automated code reviews on this repo. Configure here.

The build will fail with the following undeclared identifier error:

    memtier_benchmark.cpp:2133:18: error: use of undeclared identifier 'bitmask_is_contiguous'
     2133 |             if (!bitmask_is_contiguous(cfg->tls_protocols)) {
          |                  ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.

We can fix this by declaring it before it is used.

@fcostaoliveira fcostaoliveira left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching this, and for the clear repro in the description. The forward declaration sits under the same USE_TLS + OPENSSL_VERSION_NUMBER >= 0x40000000L guards as the definition, so nothing changes for 3.x builds. LGTM.

I guess the real gap is that we don't build against OpenSSL 4.0 in CI at all, which is how #444 got in like this — that's on us, not something for this PR. We'll also want this on the 2.5 branch.

@fcostaoliveira
fcostaoliveira merged commit fc668d7 into redis:master Oct 6, 2026
2 checks passed
@fcostaoliveira fcostaoliveira mentioned this pull request Oct 6, 2026
@collinfunk
collinfunk deleted the fix-openssl-4-build branch October 15, 2026 01:53
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