Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2108

Compilation error in ZkAdaptor.cc with GCC 4.7 or later

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4.6
    • 3.9.0
    • None

    Description

      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 :

      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);
      

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ebourg Emmanuel Bourg
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h