From cda46033f1500a274509a49161ba59b0065a41cc Mon Sep 17 00:00:00 2001 From: finger42 <67188554+finger42@users.noreply.github.com> Date: Fri, 7 Aug 2020 19:48:16 +0200 Subject: [PATCH 1/7] cmake and make using same env with CC and CXX (#258) Each "run:" call gets a new environment. With this, the first "run:" is exporting CC and CXX. In this "run:" the cmake stuff is created. The next "run:" to make, is using the default CC and CXX, which is GCC instead of clang. And then some of the stuff is build with clang other with gcc * moved cmake, make and running tests in one "run:" command, so they are sharing the same environment * fixed indention * renamed the name to Build and run * Build build-clang-9-Linux and build-clang-10-osx are similar now. Co-authored-by: finger42 --- .github/workflows/main.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65b2d26a..e9aa1075 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,19 +34,14 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - - - name: Setup cmake + - name: Build and run run: | - export CC=clang-9 - export CXX=clang++-9 - cmake -D BUILD_TESTS=ON ./ + export CC=clang-9 + export CXX=clang++-9 + cmake -D BUILD_TESTS=ON ./ + make + ./test/etl_tests - - name: Compile - run: make - - - name: Run tests - run: ./test/etl_tests - - name: Save artifacts uses: actions/upload-artifact@v2 with: From e82538eacf8cece8c9ee3429024f786ad3edb855 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Mon, 3 Aug 2020 20:33:47 +0100 Subject: [PATCH 2/7] YAML modification --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9aa1075..b73dbf6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,4 +58,4 @@ jobs: export CXX=clang++ cmake -D BUILD_TESTS=ON ./ make - ./test/etl_tests \ No newline at end of file + ./test/etl_tests From b973b01c0811f48dc02b6da40793e1ebff49ad13 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 4 Aug 2020 11:40:31 +0100 Subject: [PATCH 3/7] Experimental atomic_gcc_sync change --- include/etl/atomic/atomic_gcc_sync.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/etl/atomic/atomic_gcc_sync.h b/include/etl/atomic/atomic_gcc_sync.h index ef673eb9..7443f784 100644 --- a/include/etl/atomic/atomic_gcc_sync.h +++ b/include/etl/atomic/atomic_gcc_sync.h @@ -475,7 +475,7 @@ namespace etl // Pre-increment T* operator ++() { - return (T*)__sync_add_and_fetch(&value, sizeof(T)); + return (T*)__sync_add_and_fetch(&(volatile void*)value, sizeof(T)); } T* operator ++() volatile From 5f0dae41def04714534676d45beb2dd1c2f72d77 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 4 Aug 2020 11:57:53 +0100 Subject: [PATCH 4/7] Experimental atomic_gcc_sync change --- include/etl/atomic/atomic_gcc_sync.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/etl/atomic/atomic_gcc_sync.h b/include/etl/atomic/atomic_gcc_sync.h index 7443f784..ef673eb9 100644 --- a/include/etl/atomic/atomic_gcc_sync.h +++ b/include/etl/atomic/atomic_gcc_sync.h @@ -475,7 +475,7 @@ namespace etl // Pre-increment T* operator ++() { - return (T*)__sync_add_and_fetch(&(volatile void*)value, sizeof(T)); + return (T*)__sync_add_and_fetch(&value, sizeof(T)); } T* operator ++() volatile From d389f06cdff2367ed22856b62d81ea23cb01461d Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 7 Aug 2020 08:33:25 +0100 Subject: [PATCH 5/7] String stream test << operator --- test/test_string_stream.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_string_stream.cpp b/test/test_string_stream.cpp index c2a7bb61..4fbcaf92 100644 --- a/test/test_string_stream.cpp +++ b/test/test_string_stream.cpp @@ -63,6 +63,18 @@ namespace namespace etl { + //*********************************** + template + std::ostream& operator << (std::ostream& os, const etl::string& str) + { + for (auto c : str) + { + os << c; + } + + return os; + } + //*********************************** std::ostream& operator << (std::ostream& os, const IString& str) { From 1f2fd18d8833c1cac546dd2d77c19339ed3bf069 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 7 Aug 2020 09:39:14 +0100 Subject: [PATCH 6/7] String stream test << operator --- test/test_string_stream.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/test/test_string_stream.cpp b/test/test_string_stream.cpp index 4fbcaf92..c2a7bb61 100644 --- a/test/test_string_stream.cpp +++ b/test/test_string_stream.cpp @@ -63,18 +63,6 @@ namespace namespace etl { - //*********************************** - template - std::ostream& operator << (std::ostream& os, const etl::string& str) - { - for (auto c : str) - { - os << c; - } - - return os; - } - //*********************************** std::ostream& operator << (std::ostream& os, const IString& str) { From 50b60c025de6a5f8ee4bb2544ea3ac1c8bb451e3 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 8 Aug 2020 11:12:52 +0100 Subject: [PATCH 7/7] String stream test << operator in etl namespace --- include/etl/version.h | 2 +- library.json | 2 +- library.properties | 2 +- support/Release notes.txt | 4 +++ test/test_deque.cpp | 70 +++++++++++++++++++++++++++++++++------ 5 files changed, 67 insertions(+), 13 deletions(-) diff --git a/include/etl/version.h b/include/etl/version.h index 088f6bdc..93d64b4a 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 18 #define ETL_VERSION_MINOR 12 -#define ETL_VERSION_PATCH 3 +#define ETL_VERSION_PATCH 4 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index 1f10047b..ad2a269f 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "18.12.3", + "version": "18.12.4", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 4a136a6d..f28974df 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=18.12.3 +version=18.12.4 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 8d735e4f..6e7cfa7d 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +18.12.4 +Resolve clang 9 compatibility issues. + =============================================================================== 18.12.3 Resolve 0U constant ambiguity in string utility tests diff --git a/test/test_deque.cpp b/test/test_deque.cpp index a7000d8c..876aa4ea 100644 --- a/test/test_deque.cpp +++ b/test/test_deque.cpp @@ -533,14 +533,39 @@ namespace { DataNDC data(SIZE, N0); - DataNDC::iterator first = data.begin() + 1; - DataNDC::iterator second = data.begin() + 4; + DataNDC::iterator first = data.begin() + 1; + DataNDC::iterator second = data.begin() + 1; + DataNDC::iterator third = data.begin() + 4; - CHECK(first < second); + CHECK(first == second); + CHECK(second == first); + CHECK(!(first == third)); + CHECK(!(third == first)); + + CHECK(!(first != second)); + CHECK(!(second != first)); + CHECK(first != third); + CHECK(third != first); + + CHECK(!(first < second)); CHECK(!(second < first)); + CHECK(first < third); + CHECK(!(third < first)); - CHECK(second > first); - CHECK(!(first > second)); + CHECK(first <= second); + CHECK(second <= first); + CHECK(first <= third); + CHECK(!(third <= first)); + + CHECK(!(first > second)); + CHECK(!(second > first)); + CHECK(!(first > third)); + CHECK(third > first); + + CHECK(first >= second); + CHECK(second >= first); + CHECK(!(first >= third)); + CHECK(third >= first); } //************************************************************************* @@ -548,14 +573,39 @@ namespace { DataNDC data(SIZE, N0); - DataNDC::const_iterator first = data.cbegin() + 1; - DataNDC::const_iterator second = data.cbegin() + 4; + DataNDC::const_iterator first = data.begin() + 1; + DataNDC::const_iterator second = data.begin() + 1; + DataNDC::const_iterator third = data.begin() + 4; - CHECK(first < second); + CHECK(first == second); + CHECK(second == first); + CHECK(!(first == third)); + CHECK(!(third == first)); + + CHECK(!(first != second)); + CHECK(!(second != first)); + CHECK(first != third); + CHECK(third != first); + + CHECK(!(first < second)); CHECK(!(second < first)); + CHECK(first < third); + CHECK(!(third < first)); - CHECK(second > first); - CHECK(!(first > second)); + CHECK(first <= second); + CHECK(second <= first); + CHECK(first <= third); + CHECK(!(third <= first)); + + CHECK(!(first > second)); + CHECK(!(second > first)); + CHECK(!(first > third)); + CHECK(third > first); + + CHECK(first >= second); + CHECK(second >= first); + CHECK(!(first >= third)); + CHECK(third >= first); } //*************************************************************************