[CDRIVER-940] Build errors and warnings on mingw-w64 Created: 17/Oct/15  Updated: 13/Jan/17  Resolved: 22/Oct/15

Status: Closed
Project: C Driver
Component/s: mingw
Affects Version/s: 1.2.0
Fix Version/s: 1.2.1

Type: Bug Priority: Critical - P2
Reporter: Jeroen Ooms [X] Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File warnings.png    
Issue Links:
Related
related to CDRIVER-643 Solaris Compiler warning Closed
related to CDRIVER-959 mingw build & test in Evergreen Closed

 Description   

Version 1.2.0 no longer builds on windows because the 'ETIMEDOUT' constant is not defined. I am using mingw-w64 based on gcc-4.6.3.

mongoc/mongoc-thread-private.h:105:17: error: 'ETIMEDOUT' undeclared (first use in this function)
mongoc/mongoc-topology.c:495:19: error: 'ETIMEDOUT' undeclared (first use in this function)
mongoc/mongoc-topology.c:730:35: error: 'ETIMEDOUT' undeclared (first use in this function)

In addition mingw-w64 has a few warnings:



 Comments   
Comment by Githook User [ 11/Jan/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: mingw needs at least__USE_MINGW_ANSI_STDIO=1 to define realistic PRI* macros
Branch: 1.3.0-dev
https://github.com/mongodb/libbson/commit/5dc059fe6b32f68d305761108cc6a4815297ea1f

Comment by Githook User [ 11/Jan/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Be consistent over which PRI macros we use
Branch: 1.3.0-dev
https://github.com/mongodb/libbson/commit/11be1eec312d8aa13591d4f7f0b2d9b6dfd977d7

Comment by Githook User [ 11/Jan/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Fix build on windows(-ish) platforms
Branch: 1.3.0-dev
https://github.com/mongodb/libbson/commit/210a00bcaebd458c9030feb00c8ac6b1c6f72981

Comment by Hannes Magnusson [ 22/Oct/15 ]

There is no way for sec_ptr and millis_ptr to be used without initialization. They are only accessed with if (sec_len && ...sec_ptr) and if (millis_len && ...millis_ptr).
The *_ptr are never set without the _len being set.

I fixed the other warnings, and build failures.

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: Merge branch 'r1.2'

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Fix build on (older) mingw

Although ETIMEDOUT is defined in certain cases, it doesn't necessarily
contain the same value as WSAETIMEDOUT.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/54ecc98739001cab79bd02ef933806f3b6eaad58

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: mingw needs at least__USE_MINGW_ANSI_STDIO=1 to define realistic PRI* macros
Branch: master
https://github.com/mongodb/libbson/commit/5dc059fe6b32f68d305761108cc6a4815297ea1f

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Be consistent over which PRI macros we use
Branch: master
https://github.com/mongodb/libbson/commit/11be1eec312d8aa13591d4f7f0b2d9b6dfd977d7

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Fix build on windows(-ish) platforms
Branch: master
https://github.com/mongodb/libbson/commit/210a00bcaebd458c9030feb00c8ac6b1c6f72981

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: mingw needs at least__USE_MINGW_ANSI_STDIO=1 to define realistic PRI* macros
Branch: r1.2
https://github.com/mongodb/libbson/commit/5dc059fe6b32f68d305761108cc6a4815297ea1f

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Be consistent over which PRI macros we use
Branch: r1.2
https://github.com/mongodb/libbson/commit/11be1eec312d8aa13591d4f7f0b2d9b6dfd977d7

Comment by Githook User [ 22/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Fix build on (older) mingw

Although ETIMEDOUT is defined in certain cases, it doesn't necessarily
contain the same value as WSAETIMEDOUT.
Branch: r1.2
https://github.com/mongodb/mongo-c-driver/commit/54ecc98739001cab79bd02ef933806f3b6eaad58

Comment by Githook User [ 21/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-940: Fix build on windows(-ish) platforms
Branch: r1.2
https://github.com/mongodb/libbson/commit/210a00bcaebd458c9030feb00c8ac6b1c6f72981

Comment by Jeroen Ooms [X] [ 20/Oct/15 ]

I'm using windows. This is for the R driver, our tool chain is called 'Rtools'. You can download the latest stable version (3.2) from https://cran.r-project.org/bin/windows/Rtools/Rtools32.exe

Comment by Hannes Magnusson [ 20/Oct/15 ]

I'm having a hard time reproducing this on mingw64-gcc-4.9.2-1.fc21.x86_64

It should be WSAETIMEDOUT, but ETIMEDOUT is indeed defined just fine (as 138).

Guess I'll have to try downgrading..
What operating system are you using?

Generated at Wed Feb 07 21:11:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.