[mlpack-git] [mlpack] Reduce (or fix) warnings when compiling with Visual Studio (#554)

Cloud Han notifications at github.com
Mon Mar 21 09:40:32 EDT 2016


I inspect it in VS2015 and found
`warning C4267: 'argument': conversion from 'size_t' to 'const arma::uword', possible loss of data` is caused by `ARMA_64BIT_WORD` is no defined, which results in a `typedef u32 uword;` in file `include\armadillo_bits\typedef_elem.hpp`

To solve this type of warning, just uncomment the line with `#define ARMA_64BIT_WORD
` in the file `armadillo_bits\config.hpp`.

However, this will result in a 8 bytes `uword`, when casting to a `int`, which is 4 bytes by default, you still lose data in this procedure.

There will still be many other `possible loss of data` warning for some casting between unsigned integer and float point, but I don't think this type of data loss can be solved with only a few lines of code.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/554#issuecomment-199283436
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160321/bc3205b9/attachment.html>


More information about the mlpack-git mailing list