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

Compile error due to LOGSTREAM being null when passed to fprintf

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: c client
    • Labels:
      None

      Description

      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 3.4.x branch it was getLogStream().

      I believe this for the 3.5 branch should be zoo_get_log_stream()

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rfenner Ronald Fenner
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: