[CDRIVER-2427] Windows: mingw-w64 compiler warnings Created: 12/Dec/17  Updated: 28/Oct/23  Resolved: 13/Dec/17

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

Type: Bug Priority: Minor - P4
Reporter: Jeroen Ooms [X] Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mingw-w64 gcc-4.9.3



 Description   

Getting these compiler warnings on mingw-w64. It still works but would be nice to fix.

mingw-w64 4.9.3

c:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I../windows/openssl-1.0.2h/include -I. -Ijsonsl -Ibson -Imongoc -DBSON_COMPILATION -DMONGOC_COMPILATION -DMONGOC_HAVE_SASL_CLIENT_DONE -D__USE_MINGW_ANSI_STDIO      -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-format   -O2 -Wall  -std=gnu99 -mtune=generic -c mongoc/mongoc-sspi.c -o mongoc/mongoc-sspi.o
mongoc/mongoc-sspi.c: In function '_mongoc_sspi_auth_sspi_client_unwrap':
mongoc/mongoc-sspi.c:363:59: warning: passing argument 4 of 'DecryptMessage' from incompatible pointer type
    status = DecryptMessage (&state->ctx, &wrapBufDesc, 0, &state->qop);
                                                           ^
In file included from mongoc/mongoc-sspi-private.h:34:0,
                 from mongoc/mongoc-sspi.c:29:
C:/Rtools/mingw_64/x86_64-w64-mingw32/include/sspi.h:721:26: note: expected 'long unsigned int *' but argument is of type 'int *'
   SECURITY_STATUS WINAPI DecryptMessage(PCtxtHandle phContext,PSecBufferDesc pMessage,unsigned __LONG32 MessageSeqNo,unsigned __LONG32 *pfQOP);
                          ^
c:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-34~1.3/include" -DNDEBUG -I../windows/openssl-1.0.2h/include -I. -Ijsonsl -Ibson -Imongoc -DBSON_COMPILATION -DMONGOC_COMPILATION -DMONGOC_HAVE_SASL_CLIENT_DONE -D__USE_MINGW_ANSI_STDIO      -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-format   -O2 -Wall  -std=gnu99 -mtune=generic -c mongoc/mongoc-cluster-sspi.c -o mongoc/mongoc-cluster-sspi.o
mongoc/mongoc-cluster-sspi.c: In function '_mongoc_cluster_auth_node_sspi':
mongoc/mongoc-cluster-sspi.c:172:59: warning: pointer targets in passing argument 2 of '_mongoc_sspi_auth_sspi_client_step' differ in signedness [-Wpointer-sign]
          res = _mongoc_sspi_auth_sspi_client_step (state, buf);
                                                           ^
In file included from mongoc/mongoc-cluster-sspi.c:24:0:
mongoc/mongoc-sspi-private.h:70:1: note: expected 'SEC_CHAR *' but argument is of type 'uint8_t *'
 _mongoc_sspi_auth_sspi_client_step (mongoc_sspi_client_state_t *state,
 ^
mongoc/mongoc-cluster-sspi.c:178:61: warning: pointer targets in passing argument 2 of '_mongoc_sspi_auth_sspi_client_unwrap' differ in signedness [-Wpointer-sign]
          res = _mongoc_sspi_auth_sspi_client_unwrap (state, buf);
                                                             ^
In file included from mongoc/mongoc-cluster-sspi.c:24:0:
mongoc/mongoc-sspi-private.h:74:1: note: expected 'SEC_CHAR *' but argument is of type 'uint8_t *'
 _mongoc_sspi_auth_sspi_client_unwrap (mongoc_sspi_client_state_t *state,
 ^
mongoc/mongoc-cluster-sspi.c:181:30: warning: passing argument 3 of '_mongoc_sspi_auth_sspi_client_wrap' discards 'const' qualifier from pointer target type
             state, response, tmp_creds, tmp_creds_len, 0);
                              ^
In file included from mongoc/mongoc-cluster-sspi.c:24:0:
mongoc/mongoc-sspi-private.h:78:1: note: expected 'SEC_CHAR *' but argument is of type 'const char *'
 _mongoc_sspi_auth_sspi_client_wrap (mongoc_sspi_client_state_t *state,
 ^
mongoc/mongoc-cluster-sspi.c:250:14: warning: assignment discards 'const' qualifier from pointer target type
       tmpstr = bson_iter_utf8 (&iter, &buflen);
              ^



 Comments   
Comment by Githook User [ 14/Dec/17 ]

Author:

{'name': 'Jeroen', 'email': 'jeroenooms@gmail.com', 'username': 'jeroen'}

Message: Windows: fix SSPI compiler warnings (CDRIVER-2427)
Branch: r1.9
https://github.com/mongodb/mongo-c-driver/commit/a058588b112cd38c997c6676145280eb82390f23

Comment by Githook User [ 13/Dec/17 ]

Author:

{'name': 'Jeroen', 'email': 'jeroenooms@gmail.com', 'username': 'jeroen'}

Message: Windows: fix SSPI compiler warnings (CDRIVER-2427)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7f5d3ff7aeff1c8ab0a0a8400b6c6fa28de1802c

Comment by Jeroen Ooms [X] [ 13/Dec/17 ]

OK added this to the Windows PR: https://github.com/mongodb/mongo-c-driver/pull/474/files

Comment by A. Jesse Jiryu Davis [ 13/Dec/17 ]

Thanks, want to submit a PR please?

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