Commit 7e7146c0 authored by François Grisez's avatar François Grisez

Fix build with GCC 8.

parent 74fd021a
......@@ -270,6 +270,9 @@ else()
list(APPEND STRICT_OPTIONS_C "-Wstrict-prototypes" "-Werror=strict-prototypes")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND STRICT_OPTIONS_C "-fno-inline-small-functions")
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 8)
list(APPEND STRICT_OPTIONS_C "-Wno-error=stringop-truncation" "-Wno-error=cast-function-type" "-Wno-error=sizeof-pointer-memaccess" "-Wno-error=format-truncation")
endif()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
list(APPEND STRICT_OPTIONS_CPP "-Qunused-arguments" "-Wno-array-bounds")
......
......@@ -93,10 +93,10 @@ void RegisterInfoCommand::exec(Daemon *app, const std::string& args) {
int id;
try {
id = atoi(param.c_str());
} catch (std::invalid_argument) {
} catch (const std::invalid_argument &) {
app->sendResponse(Response("Invalid ID.", Response::Error));
return;
} catch (std::out_of_range) {
} catch (const std::out_of_range &) {
app->sendResponse(Response("Out of range ID.", Response::Error));
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment