Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build warnings and errors on LCC (eLbrus C/C++ compiler) #4607

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

cmake_minimum_required(VERSION 3.13)

cmake_policy(SET CMP0129 NEW)
project(googletest-distribution)
set(GOOGLETEST_VERSION 1.15.2)

Expand Down
1 change: 1 addition & 0 deletions googlemock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ endif()
# ${gmock_BINARY_DIR}.
# Language "C" is required for find_package(Threads).
cmake_minimum_required(VERSION 3.13)
cmake_policy(SET CMP0129 NEW)
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)

if (COMMAND set_up_hermetic_build)
Expand Down
1 change: 1 addition & 0 deletions googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ endif()
# Project version.

cmake_minimum_required(VERSION 3.13)
cmake_policy(SET CMP0129 NEW)
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)

if (COMMAND set_up_hermetic_build)
Expand Down
13 changes: 10 additions & 3 deletions googletest/cmake/internal_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ macro(config_compiler_and_linker)
if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(cxx_base_flags "${cxx_base_flags} -Wno-implicit-float-size-conversion -ffp-model=precise")
endif()
elseif (CMAKE_COMPILER_IS_GNUCXX)
set(cxx_base_flags "-Wall -Wshadow -Wundef")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "LCC")
set(cxx_base_flags "-Wall -Wundef")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
set(cxx_base_flags "${cxx_base_flags} -Wno-error=dangling-else")
endif()
set(cxx_exception_flags "-fexceptions")
Expand All @@ -115,6 +117,11 @@ macro(config_compiler_and_linker)
set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
set(cxx_strict_flags
"-Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
if (CMAKE_CXX_COMPILER_ID STREQUAL "LCC")
set(cxx_base_flags "${cxx_base_flags} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function")
else()
set(cxx_base_flags "${cxx_base_flags} -Wshadow")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
set(cxx_exception_flags "-features=except")
# Sun Pro doesn't provide macros to indicate whether exceptions and
Expand Down
2 changes: 1 addition & 1 deletion googletest/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// Ask the compiler not to perform tail call optimization inside
// the marked function.
#define GTEST_NO_TAIL_CALL_ __attribute__((disable_tail_calls))
#elif defined(__GNUC__) && !defined(__NVCOMPILER)
#elif defined(__GNUC__) && !defined(__EDG__)
#define GTEST_NO_TAIL_CALL_ \
__attribute__((optimize("no-optimize-sibling-calls")))
#else
Expand Down
4 changes: 2 additions & 2 deletions googletest/test/googletest-list-tests-unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
TypedTest/1\. # TypeParam = int\s*\*( __ptr64)?
TestA
TestB
TypedTest/2\. # TypeParam = .*MyArray<bool,\s*42>
TypedTest/2\. # TypeParam = .*MyArray<bool,\s*(\(int\))?42>
TestA
TestB
My/TypeParamTest/0\. # TypeParam = (VeryLo{245}|class VeryLo{239})\.\.\.
Expand All @@ -83,7 +83,7 @@
My/TypeParamTest/1\. # TypeParam = int\s*\*( __ptr64)?
TestA
TestB
My/TypeParamTest/2\. # TypeParam = .*MyArray<bool,\s*42>
My/TypeParamTest/2\. # TypeParam = .*MyArray<bool,\s*(\(int\))?42>
TestA
TestB
MyInstantiation/ValueParamTest\.
Expand Down
2 changes: 2 additions & 0 deletions googletest/test/googletest-output-test_.cc
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ class TypedTestNames {
return std::string("char") + ::testing::PrintToString(i);
if (std::is_same<T, int>::value)
return std::string("int") + ::testing::PrintToString(i);
return std::string("unknown");
}
};

Expand Down Expand Up @@ -755,6 +756,7 @@ class TypedTestPNames {
if (std::is_same<T, unsigned int>::value) {
return std::string("unsignedInt") + ::testing::PrintToString(i);
}
return std::string("unknown");
}
};

Expand Down
2 changes: 2 additions & 0 deletions googletest/test/gtest-typed-test_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class TypedTestNames {
if (std::is_same<T, int>::value) {
return std::string("int") + ::testing::PrintToString(i);
}
return std::string("unknown");
}
};

Expand Down Expand Up @@ -320,6 +321,7 @@ class TypeParametrizedTestNames {
if (std::is_same<T, int>::value) {
return std::string("parInt") + ::testing::PrintToString(i);
}
return std::string("unknown");
}
};

Expand Down