Resolve all C++ -O2 warnings

This commit is contained in:
John Wellbelove 2023-08-07 07:54:04 +01:00
parent a083479fcc
commit d7fd06f795
3 changed files with 216 additions and 206 deletions

View File

@ -132,7 +132,7 @@ namespace etl
#endif
// We can't have std::swap and etl::swap templates coexisting in the unit tests
// as the compiler will be unable to decide of which one to use, due to ADL.
// as the compiler will be unable to decide which one to use, due to ADL.
#if ETL_NOT_USING_STL && !defined(ETL_IN_UNIT_TEST)
//***************************************************************************
// swap

View File

@ -342,17 +342,27 @@ if (ETL_OPTIMISATION MATCHES "-O3")
endif()
if ((CMAKE_CXX_COMPILER_ID MATCHES "MSVC"))
message(STATUS "Using MSVC compiler")
target_compile_options(etl_tests
PRIVATE
/Zc:__cplusplus
)
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message(STATUS "Using GCC compiler")
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "Using Clang compiler")
endif ()
if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
target_compile_options(etl_tests
PRIVATE
-fno-omit-frame-pointer
-fno-common
-Werror=maybe-uninitialized
-Wall
-Wextra
-Werror

File diff suppressed because it is too large Load Diff