#1399 Lossy conversion warning with Visual C++

Marcel Raad

In libcurl 7.37.1, there is a new warning in conncache.c Curl_conncache_add_conn when compiling for 64-bit targets with Visual Studio:

warning C4267: '=' : conversion from 'size_t' to 'long', possible loss of data

The member connection_id of struct connectdata is a long (always a 32-bit signed integer on Visual C++) and the member next_connection_id of struct conncache is a size_t, so one of them should be changed to match the other.

Please find attached a patch for lib/conncache.h that changes the size_t in struct conncache to long (the less invasive change as that variable is only ever used in a single code line).

1 Attachments


  • Daniel Stenberg

    Daniel Stenberg - 2014-07-23
    • labels: --> compile or build problem
    • status: open --> closed-fixed
    • assigned_to: Daniel Stenberg
  • Daniel Stenberg

    Daniel Stenberg - 2014-07-23

    Thanks, merged and pushed!


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks