Skip to content

Fix make warning in hellohook,c and testmodule.c#8044

Merged
oranagra merged 2 commits intoredis:unstablefrom
sundb:fix_build_warning
Nov 13, 2020
Merged

Fix make warning in hellohook,c and testmodule.c#8044
oranagra merged 2 commits intoredis:unstablefrom
sundb:fix_build_warning

Conversation

@sundb
Copy link
Collaborator

@sundb sundb commented Nov 12, 2020

Compiling module generates some compiler warnings.

testmodule.c: In function ‘TestNotifications’:
testmodule.c:176:41: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
         RedisModule_Log(ctx, "warning", "Failed NOTIFY Test. Reason: " #msg, ##__VA_ARGS__); \
                                         ^
testmodule.c:223:13: note: in expansion of macro ‘FAIL’
             FAIL("Got reply '%.*s'. expected '1'", sz, rep);
             ^~~~
testmodule.c:176:41: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
         RedisModule_Log(ctx, "warning", "Failed NOTIFY Test. Reason: " #msg, ##__VA_ARGS__); \
                                         ^
testmodule.c:238:13: note: in expansion of macro ‘FAIL’
             FAIL("Got reply '%.*s'. expected '2'", sz, rep);
             ^~~~
ld -o testmodule.so testmodule.xo -shared  -lc
cc -I.  -W -Wall -fno-common -g -ggdb -std=c99 -O2 -fPIC -c hellocluster.c -o hellocluster.xo
ld -o hellocluster.so hellocluster.xo -shared  -lc
cc -I.  -W -Wall -fno-common -g -ggdb -std=c99 -O2 -fPIC -c hellotimer.c -o hellotimer.xo
ld -o hellotimer.so hellotimer.xo -shared  -lc
cc -I.  -W -Wall -fno-common -g -ggdb -std=c99 -O2 -fPIC -c hellodict.c -o hellodict.xo
ld -o hellodict.so hellodict.xo -shared  -lc
cc -I.  -W -Wall -fno-common -g -ggdb -std=c99 -O2 -fPIC -c hellohook.c -o hellohook.xo
hellohook.c: In function ‘clientChangeCallback’:
hellohook.c:47:44: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     printf("Client %s event for client #%llu %s:%d\n",
                                         ~~~^
                                         %lu
hellohook.c:50:9:
         ci->id,ci->addr,ci->port);
         ~~~~~~

@oranagra oranagra merged commit 204a14b into redis:unstable Nov 13, 2020
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Nov 19, 2020
* Fix build warning in hellohook,c and testmodule.c

* Change ci->id type to (unsigned long long)
@sundb sundb deleted the fix_build_warning branch November 19, 2020 02:02
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