[CDRIVER-607] Compiler warnings on mingw-w64 (gcc) Created: 04/Apr/15 Updated: 03/May/17 Resolved: 16/Feb/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | TBD |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jeroen Ooms [X] | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7, gcc 4.6.3 (mingw-w64) from the Rtools: http://cran.r-project.org/bin/windows/Rtools/ |
||
| Issue Links: |
|
||||||||
| Description |
|
Building on windows 7 with mingw-w64 a few issues come up: Found the following significant warnings:
Moreover, a linking error that only appears when building for 32bit, it does not appear for x64 (I am already including -lws2_32):
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 |
| Comments |
| Comment by A. Jesse Jiryu Davis [ 16/Feb/17 ] | |
|
Thanks Jeroen! | |
| Comment by Jeroen Ooms [ 16/Feb/17 ] | |
|
It turned out `inet_ntop` is actually missing in older versions of ming-w64 when compiling in 32bit. I ended up bundling my own version with mongolite: https://github.com/jeroenooms/mongolite/blob/master/src/win32/ipv6.c The other warning is gone because I have switched to compiling with
This makes that mingw use unix type format strings instead of windows ones. | |
| Comment by A. Jesse Jiryu Davis [ 15/Feb/17 ] | |
|
Hi Jeroen, I want to check - are these warnings and the inet_ntop linker error still issues for you with the 1.6.0 driver? | |
| Comment by Jeroen Ooms [X] [ 04/Apr/15 ] | |
|
A fix for the yajl warning is here: https://github.com/lloyd/yajl/issues/143 | |
| Comment by Hannes Magnusson [ 04/Apr/15 ] | |
|
In the PHP driver we also have an inet_pton() issue as older PHP versions provide its own inet_pton() compatibility function on Windows which conflicts with whatever header mongoc is including. | |
| Comment by Jeroen Ooms [X] [ 04/Apr/15 ] | |
|
In addition, I get this warning on x64 when compiling libbson: bson/bson.c: In function '_bson_as_json_visit_int64': |