Skip to content

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

Description

@xTeixeira

Describe the bug

When building Valkey 9.0.2 for openSUSE Tumbleweed with RDMA enabled we are getting the following 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

Additional information

Full build logs available here:
i586
armv7l

Package sources available here:
https://build.opensuse.org/package/show/server:database/valkey

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions