Add -Wconvert and address the warnings from it

closes #254
This commit is contained in:
Jason Turner
2016-03-02 17:40:15 -07:00
parent abc30ba573
commit 5a03c88ee3
3 changed files with 3 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ namespace chaiscript
#pragma GCC diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wfloat-conversion"
#endif
/// \brief Represents any numeric type, generically. Used internally for generic operations between POD values

View File

@@ -605,7 +605,7 @@ namespace {
Number = std::stod( val ) * std::pow( 10, exp );
else {
if( !exp_str.empty() )
Number = std::stol( val ) * std::pow( 10, exp );
Number = static_cast<double>(std::stol( val )) * std::pow( 10, exp );
else
Number = std::stol( val );
}