#177: libssh2 1.2.6 build error using mingw 4.5.0
-------------------------+--------------------------------------------------
 Reporter:  vszakats     |       Owner:       
     Type:  build error  |      Status:  new  
 Priority:  blocker      |   Milestone:  1.2.6
Component:  API          |     Version:  1.2.6
 Keywords:               |      Blocks:       
Blocked By:               |  
-------------------------+--------------------------------------------------
 Result (one error, one warning):

 gcc -O2 -DNDEBUG -DWIN32 -DLIBSSH2_WIN32  -fno-strict-aliasing -Wall  -I.
 -I../include -IF:\devl\openssl-1.0.0a/include
 -IF:\devl\openssl-1.0.0a/include/openssl -IF:\devl\zlib-1.2.5 -c
 ../src/scp.c -o release/scp.o
 ../src/scp.c: In function 'scp_send':
 ../src/scp.c:943:22: warning: unknown conversion type character 'l' in
 format
 ../src/scp.c:943:22: warning: format '%s' expects type 'char *', but
 argument 5 has type 'libssh2_int64_t'
 ../src/scp.c:943:22: warning: too many arguments for format
 gcc -O2 -DNDEBUG -DWIN32 -DLIBSSH2_WIN32  -fno-strict-aliasing -Wall  -I.
 -I../include -IF:\devl\openssl-1.0.0a/include
 -IF:\devl\openssl-1.0.0a/include/openssl -IF:\devl\zlib-1.2.5 -c
 ../src/agent.c -o release/agent.o
 ../src/agent.c: In function 'agent_transact_pageant':
 ../src/agent.c:289:5: warning: pointer targets in passing argument 2 of
 '_libssh2_store_str' differ in signedness
 ../src/misc.h:79:6: note: expected 'const char *' but argument is of type
 'unsigned char *'

 Patch:

 diff -r -u libssh2-1.2.6-ori\src\agent.c libssh2-1.2.6\src\agent.c
 --- libssh2-1.2.6-ori\src\agent.c       Tue May 25 14:17:00 2010
 +++ libssh2-1.2.6\src\agent.c   Tue Jun 15 17:31:27 2010
 @@ -286,7 +286,7 @@
         return -1;
      }
      p2 = p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0);
 -    _libssh2_store_str(&p2, transctx->request, transctx->request_len);
 +    _libssh2_store_str(&p2, (const char *)transctx->request,
 transctx->request_len);

      cds.dwData = PAGEANT_COPYDATA_ID;
      cds.cbData = 1 + strlen(mapname);
 diff -r -u libssh2-1.2.6-ori\src\scp.c libssh2-1.2.6\src\scp.c
 --- libssh2-1.2.6-ori\src\scp.c Sun Apr 25 10:35:22 2010
 +++ libssh2-1.2.6\src\scp.c     Tue Jun 15 17:28:57 2010
 @@ -939,7 +939,11 @@

          session->scpSend_response_len =
              snprintf((char *) session->scpSend_response,
 +#if defined( __BORLANDC__ ) || defined( _MSC_VER ) || defined(
 __MINGW32__ )
 +                     LIBSSH2_SCP_RESPONSE_BUFLEN, "C0%o %I64u %s\n",
 mode,
 +#else
                       LIBSSH2_SCP_RESPONSE_BUFLEN, "C0%o %llu %s\n", mode,
 +#endif
                       size, base);
          _libssh2_debug(session, LIBSSH2_TRACE_SCP, "Sent %s",
                         session->scpSend_response);

-- 
Ticket URL: <http://libssh2.stuge.se/ticket/177>
libssh2 <http://libssh2.stuge.se/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to