Skip to content

Fix pointer-to-int-cast warnings for RDMA address handling#3186

Merged
enjoy-binbin merged 1 commit into
valkey-io:unstablefrom
stydxm:unstable
Feb 13, 2026
Merged

Fix pointer-to-int-cast warnings for RDMA address handling#3186
enjoy-binbin merged 1 commit into
valkey-io:unstablefrom
stydxm:unstable

Conversation

@stydxm

@stydxm stydxm commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #3183

compiled (with -DBUILD_RDMA=yes) and tested (./runtest-rdma) on an armv7l Debian12 Docker container

图片

@codecov

codecov Bot commented Feb 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (42e6a0b) to head (863661f).
⚠️ Report is 5 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable   #3186       +/-   ##
============================================
- Coverage     74.94%       0   -74.95%     
============================================
  Files           129       0      -129     
  Lines         71328       0    -71328     
============================================
- Hits          53458       0    -53458     
+ Misses        17870       0    -17870     

see 129 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pizhenwei pizhenwei 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.

LGTM, thanks!

@pizhenwei

Copy link
Copy Markdown
Contributor

Hi @stydxm

Would you please take a loot at the client side and fix it? Please notify me when you create PR for the client, I'll review it too.

If you don't have enough time to fix it, please let me know.

@stydxm

stydxm commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @stydxm

Would you please take a loot at the client side and fix it? Please notify me when you create PR for the client, I'll review it too.

If you don't have enough time to fix it, please let me know.

I'll try to fix it

@stydxm

stydxm commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @stydxm

Would you please take a loot at the client side and fix it? Please notify me when you create PR for the client, I'll review it too.

If you don't have enough time to fix it, please let me know.

someone else already fixed it (valkey-io/libvalkey#252) though I didn't noticed it before, however it's not included by the latest libvalkey release (0.2.1)

maybe it would be better to upgrade the whole deps/libvalkey directory than editting one of it's file?

@pizhenwei

Copy link
Copy Markdown
Contributor

Hi @stydxm
Would you please take a loot at the client side and fix it? Please notify me when you create PR for the client, I'll review it too.
If you don't have enough time to fix it, please let me know.

someone else already fixed it (valkey-io/libvalkey#252) though I didn't noticed it before, however it's not included by the latest libvalkey release (0.2.1)

maybe it would be better to upgrade the whole deps/libvalkey directory than editting one of it's file?

Yes, we always upgrade the whole deps/libvalkey directory rather than editting any file separately.

Hi @bjosv
Is there any plan to bump the latest libvalkey into valkey? This issue blocks Valkey Over RDMA on ARM platform.

@pizhenwei

Copy link
Copy Markdown
Contributor

LGTM, thanks!

Hi @enjoy-binbin

This patch fixes the server side Valkey Over RDMA for ARM, so it could be merged.

After upgrading libvalkey, we can close this issue.

@stydxm

stydxm commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

I'll remove the edits on libvalkey, and awaiting for a new libvalkey release

Signed-off-by: stydxm <stydxm@outlook.com>
@enjoy-binbin

Copy link
Copy Markdown
Member

Merged, thanks.

@enjoy-binbin enjoy-binbin merged commit 42fc851 into valkey-io:unstable Feb 13, 2026
22 checks passed
@bjosv

bjosv commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Hi @bjosv Is there any plan to bump the latest libvalkey into valkey? This issue blocks Valkey Over RDMA on ARM platform.

Thanks for the headsup. We will tag the latest libvalkey and then I'll bump it in the valkey repo.

harrylin98 pushed a commit to harrylin98/valkey_forked that referenced this pull request Feb 19, 2026
…#3186)

When building Valkey 9 for openSUSE Tumbleweed with RDMA enabled there are some
build failures for the i586 and armv7l arches (with `-Werror`):
```
[   45s] cc -std=c99 -pedantic -O3 -fPIC -fvisibility=hidden  -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wall -Wextra -pedantic -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -Werror -g -ggdb  -Iinclude/valkey -I../../src/ -I../../src/ -MMD -MP -c src/rdma.c -o obj/rdma.o
[   45s] src/rdma.c: In function ‘rdmaPostRecv’:
[   45s] src/rdma.c:164:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
[   45s]   164 |     recv_wr.wr_id = (uint64_t)cmd;
[   45s]       |                     ^
[   45s] src/rdma.c: In function ‘rdmaSendCommand’:
[   45s] src/rdma.c:305:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
[   45s]   305 |     send_wr.wr_id = (uint64_t)_cmd;
[   45s]       |                     ^
[   45s] In file included from /usr/include/sys/types.h:176,
[   45s]                  from include/valkey/valkey.h:42,
[   45s]                  from include/valkey/async.h:34,
[   45s]                  from src/rdma.c:36:
[   45s] src/rdma.c: In function ‘connRdmaRegisterRx’:
[   45s] src/rdma.c:323:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
[   45s]   323 |     cmd.memory.addr = htobe64((uint64_t)ctx->recv_buf);
[   45s]       |                               ^
[   45s] src/rdma.c: In function ‘connRdmaHandleRecv’:
[   45s] src/rdma.c:341:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
[   45s]   341 |         ctx->tx_addr = (char *)be64toh(cmd->memory.addr);
[   45s]       |                        ^
[   45s] cc1: all warnings being treated as errors
[   45s] make[3]: *** [Makefile:228: obj/rdma.o] Error 1
```

Fixes valkey-io#3183

Signed-off-by: stydxm <stydxm@outlook.com>
hpatro pushed a commit to hpatro/valkey that referenced this pull request Mar 5, 2026
…#3186)

When building Valkey 9 for openSUSE Tumbleweed with RDMA enabled there are some
build failures for the i586 and armv7l arches (with `-Werror`):
```
[   45s] cc -std=c99 -pedantic -O3 -fPIC -fvisibility=hidden  -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wall -Wextra -pedantic -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -Werror -g -ggdb  -Iinclude/valkey -I../../src/ -I../../src/ -MMD -MP -c src/rdma.c -o obj/rdma.o
[   45s] src/rdma.c: In function ‘rdmaPostRecv’:
[   45s] src/rdma.c:164:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
[   45s]   164 |     recv_wr.wr_id = (uint64_t)cmd;
[   45s]       |                     ^
[   45s] src/rdma.c: In function ‘rdmaSendCommand’:
[   45s] src/rdma.c:305:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
[   45s]   305 |     send_wr.wr_id = (uint64_t)_cmd;
[   45s]       |                     ^
[   45s] In file included from /usr/include/sys/types.h:176,
[   45s]                  from include/valkey/valkey.h:42,
[   45s]                  from include/valkey/async.h:34,
[   45s]                  from src/rdma.c:36:
[   45s] src/rdma.c: In function ‘connRdmaRegisterRx’:
[   45s] src/rdma.c:323:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
[   45s]   323 |     cmd.memory.addr = htobe64((uint64_t)ctx->recv_buf);
[   45s]       |                               ^
[   45s] src/rdma.c: In function ‘connRdmaHandleRecv’:
[   45s] src/rdma.c:341:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
[   45s]   341 |         ctx->tx_addr = (char *)be64toh(cmd->memory.addr);
[   45s]       |                        ^
[   45s] cc1: all warnings being treated as errors
[   45s] make[3]: *** [Makefile:228: obj/rdma.o] Error 1
```

Fixes valkey-io#3183

Signed-off-by: stydxm <stydxm@outlook.com>
Signed-off-by: Harkrishn Patro <bunty.hari@gmail.com>
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.

[BUG] Build failures for targets i586, armv7l with BUILD_RDMA=yes (-Werror, pointer-to-int-cast)

4 participants