Emmanuel Bourg created ZOOKEEPER-2108:
-----------------------------------------
Summary: Compilation error in ZkAdaptor.cc with GCC 4.7 or later
Key: ZOOKEEPER-2108
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2108
Project: ZooKeeper
Issue Type: Bug
Affects Versions: 3.4.6
Reporter: Emmanuel Bourg
Priority: Minor
Hi,
Debian and Fedora have a patch fixing a compilation failure in ZkAdaptor.cc but
it doesn't appear to be fixed in the upcoming version 3.5.0. This issue is
similar to ZOOKEEPER-470 and ZOOKEEPER-1795.
The error is :
{code}
g++ -DHAVE_CONFIG_H -I. -I.. -D_FORTIFY_SOURCE=2
-I/home/ebourg/packaging/zookeeper/src/contrib/zktreeutil/../../c/include
-I/home/ebourg/packaging/zookeeper/src/contrib/zktreeutil/../../c/generated
-I../include -I/usr/local/include -I/usr/include -I/usr/include/libxml2 -g -O2
-fstack-protector-strong -Wformat -Werror=format-security -MT ZkAdaptor.o -MD
-MP -MF .deps/ZkAdaptor.Tpo -c -o ZkAdaptor.o ZkAdaptor.cc
ZkAdaptor.cc: In member function ‘void
zktreeutil::ZooKeeperAdapter::reconnect()’:
ZkAdaptor.cc:220:21: error: ‘sleep’ was not declared in this scope
sleep (1);
{code}
This is fixed by including unistd.h in ZkAdaptor.cc or ZkAdaptor.h
The Debian patch:
https://sources.debian.net/src/zookeeper/3.4.5%2Bdfsg-2/debian/patches/ftbfs-gcc-4.7.diff/
and the Fedora patch:
http://pkgs.fedoraproject.org/cgit/zookeeper.git/tree/zookeeper-3.4.5-zktreeutil-gcc.patch
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)