Skip to content

Fix function / snprintf cast - #1037

Merged
vanosg merged 1 commit into
eggheads:developfrom
michaelortmann:prepare1028
Nov 1, 2020
Merged

vanosg merged 1 commit into
eggheads:developfrom
michaelortmann:prepare1028

Conversation

@michaelortmann

@michaelortmann michaelortmann commented Oct 6, 2020 •

Copy link
Copy Markdown
Member

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
Fix function / snprintf cast in preparation of #1028

Additional description (if needed):
Found with #1028, but can/should be merged independently before #1028.

Test cases demonstrating functionality (if applicable):
No functional / visual change, just fixing what would cause the following compiler warning after #1028:

gcc -fPIC -g -O2 -pipe -Wall -I. -I../../.. -I../../.. -I../../../src/mod  -DHAVE_CONFIG_H -I/usr/include -g3 -DDEBUG -DDEBUG_ASSERT -DDEBUG_MEM -DDEBUG_DNS  -DMAKING_MODS -c .././server.mod/server.c && mv -f server.o ../
.././server.mod/server.c: In function ‘server_6char’:
.././server.mod/server.c:1240:27: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘intptr_t’ {aka ‘long int’} [-Wformat=]
 1240 |   snprintf(x, sizeof x, "%d",
      |                          ~^
      |                           |
      |                           int
      |                          %ld
 1241 |                F(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]));
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                |
      |                intptr_t {aka long int}

@vanosg
vanosg merged commit 6e9aeac into eggheads:develop Nov 1, 2020
@michaelortmann
michaelortmann deleted the prepare1028 branch November 9, 2020 23:55
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