[CDRIVER-4221] Compile warning under mingw-w64 Created: 07/Nov/21  Updated: 28/Oct/23  Resolved: 12/Nov/21

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.20.0

Type: Bug Priority: Major - P3
Reporter: Jeroen Ooms Assignee: Colby Pike
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hello, I am the maintainer of the mongolite R package.

I am trying to upgrade the vendored mongo-c-driver to the latest 1.19.2 but I am blocked by a compiler warning that we see on Windows:

 

bson/bson-atomic.c:86:35: warning: passing argument 1 of 'InterlockedExchangeAdd' from incompatible pointer type [-Wincompatible-pointer-types] 
bson/bson-atomic.c:93:35: warning: passing argument 1 of 'InterlockedExchangeAdd' from incompatible pointer type [-Wincompatible-pointer-types]

 

The exact warning is:

 

C:/rtools40/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h:1026:53: note: expected 'volatile long int *' but argument is of type 'volatile int32_t *' {aka 'volatile int *'} 

 

We use gcc-8.3.0 with mingw-w64 5.x though I don't think that matters.



 Comments   
Comment by Githook User [ 11/Nov/21 ]

Author:

{'name': 'vector-of-bool', 'email': 'vectorofbool@gmail.com', 'username': 'vector-of-bool'}

Message: Fix Win32 Warnings (#892)

  • Use a fixed-width type for the 64bit atomic emulation spinlock
  • Fix return-type warnings in thread functions
  • Incompatible pointer type for create_server_stream in cluster sspi

Fixes CDRIVER-4221
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/4a317cc303fb3e201f6813ad34921dcc5d1ca1ee

Comment by Colby Pike [ 10/Nov/21 ]

Looks to be a quirk in how MinGW and Windows handle the meaning of long

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