Fix some compile warnings & errors
* Fix type of literals
* Add explicit casts
* #include missing headers
* Replace use of non-standard u_int8_t
* Remove name of unused variables
* Fix DLL export macro - this was broken when some of the exporting headers
were moved to a different library.
Change-Id: Ie569c8df41a077b46c608798f39526352e2aeb3a
Signed-off-by: Rob Hughes <robert.hughes@arm.com>
diff --git a/profiling/common/src/CMakeLists.txt b/profiling/common/src/CMakeLists.txt
index 6979275..b4dc59f 100644
--- a/profiling/common/src/CMakeLists.txt
+++ b/profiling/common/src/CMakeLists.txt
@@ -28,6 +28,8 @@
# to simplify the build. No extra .so file to deploy to boards etc.
add_library_ex(pipeCommon STATIC ${pipeCommon_sources})
+ target_compile_definitions(pipeCommon PRIVATE "ARMNN_COMPILING_DLL")
+
# install the target
install(
TARGETS pipeCommon
diff --git a/src/armnn/Threadpool.cpp b/src/armnn/Threadpool.cpp
index a23c1e2..4289a4b 100644
--- a/src/armnn/Threadpool.cpp
+++ b/src/armnn/Threadpool.cpp
@@ -194,7 +194,7 @@
cb->Notify(Status::Success, std::make_pair(startTime, armnn::GetTimeNow())) :
cb->Notify(Status::Failure, std::make_pair(startTime, armnn::GetTimeNow()));
}
- catch (const RuntimeException &error)
+ catch (const RuntimeException&)
{
cb->Notify(Status::Failure, std::make_pair(startTime, armnn::GetTimeNow()));
}
diff --git a/src/armnn/test/EndToEndTest.cpp b/src/armnn/test/EndToEndTest.cpp
index 705258e..8a64a4b 100644
--- a/src/armnn/test/EndToEndTest.cpp
+++ b/src/armnn/test/EndToEndTest.cpp
@@ -49,7 +49,7 @@
Optimize(*net, backends, runtime->GetDeviceSpec(), OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const InvalidArgumentException& e)
+ catch (const InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/armnn/test/FlowControl.cpp b/src/armnn/test/FlowControl.cpp
index de53060..cb56873 100644
--- a/src/armnn/test/FlowControl.cpp
+++ b/src/armnn/test/FlowControl.cpp
@@ -58,7 +58,7 @@
Optimize(*net, backends, runtime->GetDeviceSpec(), OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const InvalidArgumentException& e)
+ catch (const InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/armnn/test/RuntimeTests.cpp b/src/armnn/test/RuntimeTests.cpp
index 8fa5e3e..4652d1c 100644
--- a/src/armnn/test/RuntimeTests.cpp
+++ b/src/armnn/test/RuntimeTests.cpp
@@ -270,7 +270,7 @@
errMessages);
FAIL("An exception should have been thrown");
}
- catch (const InvalidArgumentException& e)
+ catch (const InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/armnnTfLiteParser/test/L2Normalization.cpp b/src/armnnTfLiteParser/test/L2Normalization.cpp
index f4eeaac..76bb945 100644
--- a/src/armnnTfLiteParser/test/L2Normalization.cpp
+++ b/src/armnnTfLiteParser/test/L2Normalization.cpp
@@ -8,6 +8,7 @@
#include <string>
#include <iostream>
+#include <numeric>
TEST_SUITE("TensorflowLiteParser_L2Normalization")
{
diff --git a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
index dcea9ef..012737e 100644
--- a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
+++ b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
@@ -96,7 +96,7 @@
Optimize(*net, backends, runtime->GetDeviceSpec(), armnn::OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const armnn::InvalidArgumentException& e)
+ catch (const armnn::InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
@@ -216,7 +216,7 @@
Optimize(*net, backends, runtime->GetDeviceSpec(), armnn::OptimizerOptions(), errMessages);
FAIL("Should have thrown an exception.");
}
- catch (const armnn::InvalidArgumentException& e)
+ catch (const armnn::InvalidArgumentException&)
{
// Different exceptions are thrown on different backends
}
diff --git a/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp
index aec57db..92bce4f 100644
--- a/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/CastTestImpl.cpp
@@ -113,7 +113,7 @@
const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager,
const armnn::ITensorHandleFactory& tensorHandleFactory)
{
- std::vector<u_int8_t> inputValues = { 1, 3, 1, 3, 1, 3, 1, 3, 1,
+ std::vector<uint8_t> inputValues = { 1, 3, 1, 3, 1, 3, 1, 3, 1,
3, 1, 3, 1, 2, 1, 3, 1, 3 };
std::vector<float> outputValues = { 1.0f, 3.0f, 1.0f, 3.0f, 1.0f, 3.0f, 1.0f, 3.0f, 1.0f,
3.0f, 1.0f, 3.0f, 1.0f, 2.0f, 1.0f, 3.0f, 1.0f, 3.0f };
diff --git a/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp
index e242fd3..11c9766 100644
--- a/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/L2NormalizationTestImpl.cpp
@@ -16,6 +16,8 @@
#include <test/TensorHelpers.hpp>
+#include <numeric>
+
namespace
{
diff --git a/src/backends/reference/workloads/BaseIterator.hpp b/src/backends/reference/workloads/BaseIterator.hpp
index 483ef72..e09371f 100644
--- a/src/backends/reference/workloads/BaseIterator.hpp
+++ b/src/backends/reference/workloads/BaseIterator.hpp
@@ -456,7 +456,7 @@
for (uint32_t i = 0; i < size; ++i)
{
this->operator[](i);
- decodedTensor.emplace_back(*m_Iterator);
+ decodedTensor.emplace_back(static_cast<float>(*m_Iterator));
}
return decodedTensor;
diff --git a/src/backends/reference/workloads/Reduce.cpp b/src/backends/reference/workloads/Reduce.cpp
index 392ef8e..8bf422a 100644
--- a/src/backends/reference/workloads/Reduce.cpp
+++ b/src/backends/reference/workloads/Reduce.cpp
@@ -85,7 +85,7 @@
{
case ReduceOperation::Mean:
case ReduceOperation::Sum:
- std::fill(tempOut.begin(), tempOut.end(), 0.0);
+ std::fill(tempOut.begin(), tempOut.end(), 0.0f);
break;
case ReduceOperation::Max:
std::fill(tempOut.begin(), tempOut.end(), -1 * std::numeric_limits<float>::max());