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

Compiler warnings on mingw-w64 (gcc)

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • TBD
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      Windows 7, gcc 4.6.3 (mingw-w64) from the Rtools: http://cran.r-project.org/bin/windows/Rtools/

      Building on windows 7 with mingw-w64 a few issues come up:

      Found the following significant warnings:

        yajl/yajl_gen.c:205:5: warning: too many arguments for format [-Wformat-extra-args]
        bson/bson-error.c:111:4: warning: implicit declaration of function 'strerror_s' [-Wimplicit-function-declaration]
        mongoc/mongoc-socket.c:1131:7: warning: implicit declaration of function 'inet_ntop' [-Wimplicit-function-declaration]
        mongoc/mongoc-ssl.c:224:4: warning: implicit declaration of function 'inet_pton' [-Wimplicit-function-declaration]
      

      Moreover, a linking error that only appears when building for 32bit, it does not appear for x64 (I am already including -lws2_32):

      ./libmongoc.a(mongoc-socket.o):mongoc-socket.c:(.text+0x1373): undefined reference to `inet_ntop'
      ./libmongoc.a(mongoc-socket.o):mongoc-socket.c:(.text+0x13b3): undefined reference to `inet_ntop'
      ./libmongoc.a(mongoc-ssl.o):mongoc-ssl.c:(.text+0x3bc): undefined reference to `inet_pton'
      collect2: ld returned 1 exit status
      

      I am currently working around this by shipping my own implementation of inet_ntop and inet_pton from but it would be great if this would be fixed in the library. Some example implementations: http://stackoverflow.com/questions/15660203/inet-pton-identifier-not-found

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            Jeroenooms Jeroen Ooms [X]
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: