You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Mate Szalay-Beko (Jira)" <ji...@apache.org> on 2022/05/04 14:51:00 UTC

[jira] [Resolved] (ZOOKEEPER-2108) Compilation error in ZkAdaptor.cc with GCC 4.7 or later

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mate Szalay-Beko resolved ZOOKEEPER-2108.
-----------------------------------------
    Fix Version/s: 3.9.0
       Resolution: Fixed

Issue resolved by pull request 1870
[https://github.com/apache/zookeeper/pull/1870]

> 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
>              Labels: pull-request-available
>             Fix For: 3.9.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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
(v8.20.7#820007)