Skip to content
Snippets Groups Projects
Commit 9824a1b6 authored by Pietro Fezzardi's avatar Pietro Fezzardi Committed by Alessandro Di Federico
Browse files

Make `-Wnoexcept-type` non-fatal, if present

This warning was introduced with gcc-7 to (quoting the documentation)
"Warn if the C++1z feature making noexcept part of a function type
changes the mangled name of a symbol relative to C++14. Enabled by -Wabi
and -Wc++1z-compat.".

It is triggered from the `GenericFunctor` class template. It can be
safely made not fatal, because this class template is not exposed
outside and the whole project is currently compiled with the same C++
standard compiler flags.

This commit adds machinery to `CMakeLists.txt` to make the warning not
fatal, but only if present. Disabling it when not present would trigger
build errors.
parent 069ae70d
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,13 @@ include_directories("${QEMU_INSTALL_PATH}/include/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror -Wno-error=unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=return-type")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-function")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-Wno-error=noexcept-type" COMPILER_SUPPORTS_WARN_NOEXCEPT_TYPE)
if (COMPILER_SUPPORTS_WARN_NOEXCEPT_TYPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=noexcept-type")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-but-set-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=maybe-uninitialized")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment