From ee9b93317b537bd18fa441e37cbc3d16cc1e4a52 Mon Sep 17 00:00:00 2001 From: Christos Houtouridis Date: Thu, 14 Nov 2019 13:43:25 +0200 Subject: [PATCH] DEV: Makefile rule correction and some warning suppression --- include/utl/com/_1wire_id.h | 7 ++++++- test/Makefile | 17 ++++++++--------- test/gtest/gtest/gtest.h | 12 ++++++------ test/tests/test_1w_impl.cpp | 2 +- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/include/utl/com/_1wire_id.h b/include/utl/com/_1wire_id.h index 3dd1845..73cf164 100644 --- a/include/utl/com/_1wire_id.h +++ b/include/utl/com/_1wire_id.h @@ -38,9 +38,14 @@ namespace utl { public: _1wire_id_t () noexcept : id_t {0, 0, 0, 0, 0, 0, 0, 0} { } - _1wire_id_t (const _1wire_id_t& id) noexcept { + constexpr _1wire_id_t (const _1wire_id_t& id) noexcept { std::copy(id.begin(), id.end(), this->begin()); } + _1wire_id_t operator=(const _1wire_id_t& id) noexcept { + _1wire_id_t r; + std::copy(id.begin(), id.end(), r.begin()); + return r; + } //!@} /*! * \name User functionality provided by the interface diff --git a/test/Makefile b/test/Makefile index b99e99a..93a6bfd 100644 --- a/test/Makefile +++ b/test/Makefile @@ -20,7 +20,7 @@ # # ========== Project settings ========== -TARGET := utlTest +TARGET := utlTest.exe SRC_DIR := tests gtest INC_DIR := ../include gtest EXC_FILE := @@ -36,7 +36,7 @@ CXX := g++ CPP := g++ -E CSIZE := size -CFLAGS := -std=c++14 -Wall #-Wextra +CFLAGS := -std=c++14 -Wall -Wextra DEB_FLAGS := -DDEBUG -g3 REL_FLAGS := -O3 LDFLAGS := @@ -91,16 +91,15 @@ $(DEP): include $(wildcard $(DEP)) # main target rule -$(BUILD_DIR)/%/$(TARGET): $(OBJ) +$(BUILD_DIR)/$(TARGET): $(OBJ) @mkdir -p $(@D) @echo Linking to target: $(TARGET) @echo $(CXX) $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) '$$(OBJ)' @$(CXX) $(LDFLAGS) $(MAP_FLAG) -o $(@D)/$(TARGET) $(OBJ) + @echo + @echo Print size information + @$(CSIZE) $(@D)/$(TARGET) @echo Done -# @echo -# @echo Print size information -# @$(CSIZE) $(@D)/$(TARGET) - .PHONY: clean @@ -118,12 +117,12 @@ clean: .PHONY: debug debug: CFLAGS += $(DEB_FLAGS) -debug: $(BUILD_DIR)/debug/$(TARGET) +debug: $(BUILD_DIR)/$(TARGET) .PHONY: release release: CFLAGS += $(REL_FLAGS) -release: clean $(BUILD_DIR)/release/$(TARGET) +release: clean $(BUILD_DIR)/$(TARGET) .PHONY: all diff --git a/test/gtest/gtest/gtest.h b/test/gtest/gtest/gtest.h index 505b879..e46bde2 100644 --- a/test/gtest/gtest/gtest.h +++ b/test/gtest/gtest/gtest.h @@ -15686,11 +15686,11 @@ class TestEventListener { virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; // Fired before the test suite starts. - virtual void OnTestSuiteStart(const TestSuite& test_suite) {} + virtual void OnTestSuiteStart(const TestSuite& test_suite) { (void)test_suite; } // Legacy API is deprecated but still available #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - virtual void OnTestCaseStart(const TestCase& test_case) {} + virtual void OnTestCaseStart(const TestCase& test_case) { (void)test_case; } #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ // Fired before the test starts. @@ -15705,11 +15705,11 @@ class TestEventListener { virtual void OnTestEnd(const TestInfo& test_info) = 0; // Fired after the test suite ends. - virtual void OnTestSuiteEnd(const TestSuite& test_suite) {} + virtual void OnTestSuiteEnd(const TestSuite& test_suite) { (void)test_suite; } // Legacy API is deprecated but still available #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - virtual void OnTestCaseEnd(const TestCase& test_case) {} + virtual void OnTestCaseEnd(const TestCase& test_case) { (void)test_case; } #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ // Fired before environment tear-down for each iteration of tests starts. @@ -15741,7 +15741,7 @@ class EmptyTestEventListener : public TestEventListener { void OnTestSuiteStart(const TestSuite& /*test_suite*/) override {} // Legacy API is deprecated but still available #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - void OnTestCaseStart(const TestCase& tc /*test_suite*/) override {} + void OnTestCaseStart(const TestCase& tc /*test_suite*/) override { (void)tc; } #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ void OnTestStart(const TestInfo& /*test_info*/) override {} @@ -15749,7 +15749,7 @@ class EmptyTestEventListener : public TestEventListener { void OnTestEnd(const TestInfo& /*test_info*/) override {} void OnTestSuiteEnd(const TestSuite& /*test_suite*/) override {} #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - void OnTestCaseEnd(const TestCase& tc /*test_suite*/) override {} + void OnTestCaseEnd(const TestCase& tc /*test_suite*/) override { (void)tc; } #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {} diff --git a/test/tests/test_1w_impl.cpp b/test/tests/test_1w_impl.cpp index 571d4ef..489d3a9 100644 --- a/test/tests/test_1w_impl.cpp +++ b/test/tests/test_1w_impl.cpp @@ -36,7 +36,7 @@ namespace test_1w { // return the given. This also mean no-device return byte; } - void UART_BR (uint32_t br) {} // imaginary baud-rate implementation + void UART_BR (uint32_t br) { (void)br; } // imaginary baud-rate implementation }; // fixture