Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

fix: compile error of zookeeper 3.4.10 on gcc9 #685

Merged
merged 3 commits into from
Dec 16, 2020

Conversation

neverchanje
Copy link
Contributor

@neverchanje neverchanje commented Dec 13, 2020

compilation error

src/zookeeper.c: In function 'format_endpoint_info':
src/zookeeper.c:3469:21: error: '%d' directive writing between 1 and 5 bytes into a region of size between 0 and 127 [-Werror=format-overflow=]
 3469 |     sprintf(buf,"%s:%d",addrstr,ntohs(port));
      |                     ^~
src/zookeeper.c:3469:17: note: directive argument in the range [0, 65535]
 3469 |     sprintf(buf,"%s:%d",addrstr,ntohs(port));
      |                 ^~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ./include/zookeeper.h:29,
                 from src/zookeeper.c:27:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 3 and 134 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

GCC9 generates errors on the zookeeper c client 3.4.10. My previous attempt on this issue: #667

@neverchanje neverchanje added the thirdparty-modified If this PR modified some thirdparties that need to be entirely rebuilt. label Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
thirdparty-modified If this PR modified some thirdparties that need to be entirely rebuilt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants