Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1563

examples/c/proactor/broker.c does not compile on centos 7

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: proton-c-0.18.0
    • Component/s: proton-c
    • Labels:
      None

      Description

      cd /usr/share/proton-0.18.0/examples/c
      + cmake .
      – The C compiler identification is GNU 4.8.5
      – The CXX compiler identification is GNU 4.8.5
      – Check for working C compiler: /usr/bin/cc
      – Check for working C compiler: /usr/bin/cc – works
      – Detecting C compiler ABI info
      – Detecting C compiler ABI info - done
      – Check for working CXX compiler: /usr/bin/c++
      – Check for working CXX compiler: /usr/bin/c++ – works
      – Detecting CXX compiler ABI info
      – Detecting CXX compiler ABI info - done
      – Looking for include file pthread.h
      – Looking for include file pthread.h - found
      – Looking for pthread_create
      – Looking for pthread_create - not found
      – Looking for pthread_create in pthreads
      – Looking for pthread_create in pthreads - not found
      – Looking for pthread_create in pthread
      – Looking for pthread_create in pthread - found
      – Found Threads: TRUE
      CMake Warning (dev) in CMakeLists.txt:
      No cmake_minimum_required command is present. A line of code such as

      cmake_minimum_required(VERSION 2.8)

      should be added at the top of the file. The version specified may be lower
      if you wish to support older CMake versions for this project. For more
      information run "cmake --help-policy CMP0000".
      This warning is for project developers. Use -Wno-dev to suppress it.

      – Configuring done
      – Generating done
      – Build files have been written to: /usr/share/proton-0.18.0/examples/c
      + make
      Scanning dependencies of target proactor-broker
      [ 10%] Building C object proactor/CMakeFiles/proactor-broker.dir/broker.o
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'queue_destroy':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:83:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (size_t i = 0; i < q->messages.len; ++i)
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:83:3: note: use option -std=c99 or -std=gnu99 to compile your code
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:86:15: error: redefinition of 'i'
      for (size_t i = 0; i < q->waiting.len; ++i)
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:83:15: note: previous definition of 'i' was here
      for (size_t i = 0; i < q->messages.len; ++i)
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:86:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (size_t i = 0; i < q->waiting.len; ++i)
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'queue_receive':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:143:5: error: 'for' loop initial declarations are only allowed in C99 mode
      for (size_t i = 0; i < q->waiting.len; ++i) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'queues_destroy':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:166:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (queue_t *q = qs->queues; q; q = q->next) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'queue_unsub':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:213:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (size_t i = 0; i < q->waiting.len; ++i) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'connection_unsub':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:236:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (pn_link_t *l = pn_link_head(c, 0); l != NULL; l = pn_link_next(l, 0))
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'session_unsub':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:242:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (pn_link_t *l = pn_link_head(c, 0); l != NULL; l = pn_link_next(l, 0)) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'handle':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:293:8: error: 'for' loop initial declarations are only allowed in C99 mode
      for (pn_link_t *l = pn_link_head(c, flags); l != NULL; l = pn_link_next(l, flags))
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c: In function 'main':
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:413:15: error: conflicting types for 'i'
      for (size_t i = 0; i < b.threads-1; ++i) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:402:7: note: previous definition of 'i' was here
      int i = 1;
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:413:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (size_t i = 0; i < b.threads-1; ++i) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:418:15: error: redefinition of 'i'
      for (size_t i = 0; i < b.threads-1; ++i) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:413:15: note: previous definition of 'i' was here
      for (size_t i = 0; i < b.threads-1; ++i) {
      ^
      /usr/share/proton-0.18.0/examples/c/proactor/broker.c:418:3: error: 'for' loop initial declarations are only allowed in C99 mode
      for (size_t i = 0; i < b.threads-1; ++i) {
      ^
      make[2]: *** [proactor/CMakeFiles/proactor-broker.dir/broker.o] Error 1
      make[1]: *** [proactor/CMakeFiles/proactor-broker.dir/all] Error 2

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aconway Alan Conway
                Reporter:
                iboverma Irina Boverman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: