Commit 2d05276d authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

Merge pull request #185 from NervanaSystems/bob/warnings

Bob/warnings
parents ba8d13da 085fd3fb
......@@ -16,35 +16,16 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=inconsistent-missing-override")
# whitelist errors here
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undef")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-exit-time-destructors")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-prototypes")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-disabled-macro-expansion")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pedantic")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-documentation")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
# # should remove these
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-potentially-evaluated-expression") # Triggers false alarms on typeid
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables") # Not ready for this yet
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-duplicate-enum") # from numpy
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-used-but-marked-unused") # from sox
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-compat-deprecated-writable-strings")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-double-promotion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-func-template")
......@@ -71,7 +71,8 @@ namespace ngraph
/// graph against the graph.
bool is_same_op_type(const std::shared_ptr<Node>& node) const
{
return typeid(*this) == typeid(*node.get());
Node* n = node.get();
return typeid(*this) == typeid(*n);
}
std::shared_ptr<const ValueType> get_value_type() { return m_value_type; }
......
......@@ -46,7 +46,7 @@ bool ngraph::element::Type::operator==(const element::Type& other) const
size_t ngraph::element::Type::size() const
{
return std::ceil((float)m_bitwidth / 8.0);
return std::ceil(static_cast<float>(m_bitwidth) / 8.0f);
}
std::ostream& ngraph::element::operator<<(std::ostream& out, const ngraph::element::Type& obj)
......
......@@ -39,7 +39,8 @@ void ngraph::dump(ostream& out, const void* _data, size_t _size)
{
if (index + i < len)
{
out << " " << std::hex << std::setw(2) << std::setfill('0') << (uint32_t)data[i];
out << " " << std::hex << std::setw(2) << std::setfill('0')
<< static_cast<uint32_t>(data[i]);
}
else
{
......@@ -51,7 +52,8 @@ void ngraph::dump(ostream& out, const void* _data, size_t _size)
{
if (index + i < len)
{
out << " " << std::hex << std::setw(2) << std::setfill('0') << (uint32_t)data[i];
out << " " << std::hex << std::setw(2) << std::setfill('0')
<< static_cast<uint32_t>(data[i]);
}
else
{
......
......@@ -34,7 +34,7 @@ public:
{
m_data[0] = random_generator();
m_data[1] = random_generator();
uint8_t* p = (uint8_t*)m_data;
uint8_t* p = reinterpret_cast<uint8_t*>(m_data);
p[6] = (p[6] & 0x0F) | 0x40;
p[8] = (p[8] & 0x3F) | 0x80;
}
......@@ -42,21 +42,31 @@ public:
std::string to_string() const
{
std::stringstream ss;
uint8_t* p = (uint8_t*)m_data;
const uint8_t* p = reinterpret_cast<const uint8_t*>(m_data);
for (int i = 0; i < 4; i++)
ss << std::hex << std::setw(2) << std::setfill('0') << (int)*p++;
{
ss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(*p++);
}
ss << "-";
for (int i = 0; i < 2; i++)
ss << std::hex << std::setw(2) << std::setfill('0') << (int)*p++;
{
ss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(*p++);
}
ss << "-";
for (int i = 0; i < 2; i++)
ss << std::hex << std::setw(2) << std::setfill('0') << (int)*p++;
{
ss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(*p++);
}
ss << "-";
for (int i = 0; i < 2; i++)
ss << std::hex << std::setw(2) << std::setfill('0') << (int)*p++;
{
ss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(*p++);
}
ss << "-";
for (int i = 0; i < 6; i++)
ss << std::hex << std::setw(2) << std::setfill('0') << (int)*p++;
{
ss << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(*p++);
}
return ss.str();
}
......@@ -68,11 +78,7 @@ public:
return rc;
}
bool operator==(const uuid_type& other) const
{
return memcmp((char*)m_data, (char*)other.m_data, 16) == 0;
}
bool operator==(const uuid_type& other) const { return memcmp(m_data, other.m_data, 16) == 0; }
bool operator!=(const uuid_type& other) const { return !(*this == other); }
friend std::ostream& operator<<(std::ostream& out, const uuid_type& id)
{
......
......@@ -25,7 +25,7 @@ int main(int argc, char** argv)
const char* exclude = "--gtest_filter=-benchmark.*";
vector<char*> argv_vector;
argv_vector.push_back(argv[0]);
argv_vector.push_back((char*)exclude);
argv_vector.push_back(const_cast<char*>(exclude));
for (int i = 1; i < argc; i++)
{
argv_vector.push_back(argv[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment