Ronald Fenner created ZOOKEEPER-3569:
----------------------------------------
Summary: Compile error due to LOGSTREAM being null when passed to
fprintf
Key: ZOOKEEPER-3569
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3569
Project: ZooKeeper
Issue Type: Bug
Components: c client
Reporter: Ronald Fenner
I'm trying to compile the source and getting this error
make all-am
make[1]: Entering directory
`/home/ec2-user/zookeeper/zookeeper-client/zookeeper-client-c'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include
-I./tests -I./generated -Wall -Werror -Wdeclaration-after-statement -g -O2
-D_GNU_SOURCE -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o
zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated
-Wall -Werror -Wdeclaration-after-statement -g -O2 -D_GNU_SOURCE -MT
zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c src/zookeeper.c -fPIC -DPIC -o
.libs/zookeeper.o
src/zookeeper.c: In function 'print_completion_queue':
src/zookeeper.c:2542:5: error: null argument where non-null required (argument
1) [-Werror=nonnull]
fprintf(LOGSTREAM,"Completion queue: ");
^~~~~~~
src/zookeeper.c:2544:9: error: null argument where non-null required (argument
1) [-Werror=nonnull]
fprintf(LOGSTREAM,"empty\n");
^~~~~~~
src/zookeeper.c:2550:9: error: null argument where non-null required (argument
1) [-Werror=nonnull]
fprintf(LOGSTREAM,"%d,",cptr->xid);
^~~~~~~
src/zookeeper.c:2553:5: error: null argument where non-null required (argument
1) [-Werror=nonnull]
fprintf(LOGSTREAM,"end\n");
^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [zookeeper.lo] Error 1
make[1]: Leaving directory
`/home/ec2-user/zookeeper/zookeeper-client/zookeeper-client-c'
make: *** [all] Error 2
Looking through the code in include/zookeeper_log.h at line 30 LOGSTREAM is
defined as NULL. This cause the above error.
In the 4.4.x branch it was getLogStream().
I believe this for the 3.5 branch should be zoo_get_log_stream()
--
This message was sent by Atlassian Jira
(v8.3.4#803005)