Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4470

mongoc 1.23.0 compile tests require c99 standard

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 1.23.0
    • Component/s: None
    • None

      Summary

      test-mongoc-client-side-encryption.c.o fails to compile due to loop declaration requiring c99 standard.

      Error message while running cmake:

      [ 87%] Building C object src/libmongoc/CMakeFiles/test-libmongoc.dir/tests/test-mongoc-client-side-encryption.c.o
      /home/jbecker/src/mongo_drivers/mongoc/mongo-c-driver-1.23.0/src/libmongoc/tests/test-mongoc-client-side-encryption.c: In function âtest_rewrap_with_separate_client_encryptionâ:
      /home/jbecker/src/mongo_drivers/mongoc/mongo-c-driver-1.23.0/src/libmongoc/tests/test-mongoc-client-side-encryption.c:4922:4: error: âforâ loop initial declarations are only allowed in C99 mode
          for (size_t src_idx = 0u; src_idx < providers_len; ++src_idx) {
          ^
      /home/jbecker/src/mongo_drivers/mongoc/mongo-c-driver-1.23.0/src/libmongoc/tests/test-mongoc-client-side-encryption.c:4922:4: note: use option -std=c99 or -std=gnu99 to compile your code
      /home/jbecker/src/mongo_drivers/mongoc/mongo-c-driver-1.23.0/src/libmongoc/tests/test-mongoc-client-side-encryption.c:4923:7: error: âforâ loop initial declarations are only allowed in C99 mode
             for (size_t dst_idx = 0u; dst_idx < providers_len; ++dst_idx) {
      

      Environment

      OS version: Red Hat Enterprise Linux Server release 7.9 (Maipo)

      C driver version: 1.23.0

      Compiler: gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

      cmake command:

      /home/jbecker/src/mongo_drivers/mongoc/cmake-3.23.2-linux-x86_64/bin/cmake -G "Unix Makefiles" \
              -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
              -DCMAKE_INSTALL_PREFIX=/home/jbecker/src/mongo_drivers/mongoc/output \
              -DENABLE_SSL=OPENSSL \
              -DOPENSSL_SSL_LIBRARY=/home/jbecker/src/lib/libosi_ssl.so \
              -DOPENSSL_CRYPTO_LIBRARY=/home/jbecker/src/lib/libosi_crypto.so \
              -DOPENSSL_INCLUDE_DIR=/home/jbecker/src/include \
              -DENABLE_SASL=OFF \
              -DENABLE_SHM_COUNTERS=OFF \
              -DBUILD_VERSION=1.23.0

      How to Reproduce

      Run cmake build with the above versions

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            john.becker John Becker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: