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

Compiler warnings on mingw-w64 (gcc)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: TBD
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7, gcc 4.6.3 (mingw-w64) from the Rtools: http://cran.r-project.org/bin/windows/Rtools/
    • Sprint:
      C Driver 2017 2 - Feb 10, 2018, C Driver 2017 2 - Feb 10, 2019

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jesse A. Jesse Jiryu Davis
              Reporter:
              Jeroenooms Jeroen Ooms [X] (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: