Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1049

Build warnings with CLang/LLVM

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0-RC1, 1.4.0
    • Affects Version/s: None
    • Component/s: None
    • None

      When building the PHP driver, I received the following warning:

      /Users/katherinewalker/drivers/driver-mongo-php/src/BSON/ObjectId.c:372:15: error: address of array 'intern->oid' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
              if (!intern->oid) {
                  ~~~~~~~~~^~~
      

      Here is the output of gcc --verison:

      Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
      Apple LLVM version 8.1.0 (clang-802.0.42)
      Target: x86_64-apple-darwin16.6.0
      Thread model: posix
      InstalledDir: /Library/Developer/CommandLineTools/usr/bin
      

      Here are the build flags:

      mongodb was configured with the following options:
      
      Build configuration:
        CFLAGS                                           : -g -O2
        Extra CFLAGS                                     : -g -O0 -Wall -D_THREAD_SAFE -pthread
        Developers flags (slow)                          :  -Wmissing-format-attribute -Wduplicate-enum -Wheader-guard -Wlogical-not-parentheses -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wlogical-op-parentheses -Wbool-conversion -Wloop-analysis -Wsizeof-array-argument -Wstring-conversion -Wno-variadic-macros -Wno-sign-compare -fstack-protector -fno-exceptions -Wformat-security -Wformat-nonliteral -Winit-self -Wwrite-strings -Wenum-compare -Wempty-body -Wparentheses -Wdeclaration-after-statement -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
        Code Coverage flags (extra slow)                 :
        System mongoc                                    : no
        System libbson                                   : no
        LDFLAGS                                          :
        EXTRA_LDFLAGS                                    :
        MONGODB_SHARED_LIBADD                            : -lsasl2 -Wl,-rpath,/usr/local/opt/openssl//lib -L/usr/local/opt/openssl//lib -lcrypto -lssl -lcrypto
      

            Assignee:
            derick Derick Rethans
            Reporter:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: