AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
108 stars 30 forks source link

warning C4244: '=': conversion from 'double' to '__int64', possible loss of data #1967

Open dweindl opened 1 year ago

dweindl commented 1 year ago

With MSVC.

https://github.com/AMICI-dev/AMICI/actions/runs/4054783843/jobs/6977046562

Not sure if that's an issue in KLU or whether we have some problem in amici. Need to double check.

  amici\ThirdParty\SuiteSparse\KLU\Source\klu.c(119): warning C4244: '=': conversion from 'double' to '__int64', possible loss of data
  amici\ThirdParty\SuiteSparse\KLU\Source\klu.c(123): warning C4244: '=': conversion from 'double' to '__int64', possible loss of data
  amici\ThirdParty\SuiteSparse\KLU\Source\klu.c(133): warning C4244: '=': conversion from 'double' to '__int64', possible loss of data
  amici\ThirdParty\SuiteSparse\KLU\Source\klu.c(134): warning C4244: '=': conversion from 'double' to '__int64', possible loss of data

    amici\ThirdParty\SuiteSparse\KLU\Source\klu_analyze.c(138): warning C4244: '=': conversion from '__int64' to 'double', possible loss of data
  amici\ThirdParty\SuiteSparse\KLU\Source\klu_analyze.c(139): warning C4244: '=': conversion from '__int64' to 'double', possible loss of data
  amici\ThirdParty\SuiteSparse\KLU\Source\klu_analyze.c(159): warning C4244: '=': conversion from 'double' to 'size_t', possible loss of data
  amici\ThirdParty\SuiteSparse\KLU\Source\klu_analyze.c(162): warning C4244: '=': conversion from '__int64' to 'double', possible loss of data
  amici\ThirdParty\SuiteSparse\KLU\Source\klu_analyze.c(200): warning C4244: '=': conversion from '__int64' to 'double', possible loss of data
MBchaos commented 1 year ago

It is a KLU issue line 71 double Lsize, /* estimate of number of nonzeros in L */ line 101 double maxlnz, dunits ; line 104 Int lsize, usize, anz, ok ;

warnings at line 119 lsize = Lsize * anz + n ; line 123 lsize = Lsize ; line 133-134 lsize = MIN (maxlnz, lsize) ; usize = MIN (maxlnz, usize) ;

It is converting from different types. It should not be only on windows since there is double to int conversion. You could solve it with a cast if you are sure the code is self-consistent

dweindl commented 1 year ago

It is a KLU issue

Thanks for checking. I assume this is intentional in SuiteSparse/KLU. We should just silence those warnings for third-party code then.