coin-or / Cbc

COIN-OR Branch-and-Cut solver
Other
814 stars 115 forks source link

Converting from size_t to int can result in data loss if the value of size_t exceeds the range that int can represent. #672

Open megapixelrealestatecom opened 1 month ago

megapixelrealestatecom commented 1 month ago

I just finished building v17 with the current Master but there are a couple of issues to addres, here is the output:

Build succeeded. 12> 12>C:\Coin-or\Clp\src\ClpParameters.hpp(84,22): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data 12>C:\Coin-or\Cbc\src\CbcParameters.hpp(574,22): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data 12>C:\Coin-or\CoinUtils\src\CoinHelperFunctions.hpp(360,19): warning C4244: 'argument': conversion from 'const CoinByteArray' to 'const CoinBigIndex', possible loss of data 12> 3 Warning(s) 12> 0 Error(s) 12> 12>Time Elapsed 00:00:04.21 ========== Rebuild All: 12 succeeded, 0 failed, 0 skipped ========== ========== Rebuild completed at 4:51 PM and took 05:15.530 minutes ==========

megapixelrealestatecom commented 1 month ago

These warnings indicate potential issues where data might be truncated or lost due to type conversions. Even though the build succeeded, addressing these warnings is important to avoid future bugs or runtime issues, especially when handling large data or different platforms (32-bit vs. 64-bit).