Skip to content
Permalink
Browse files

Merge pull request #228 from tuxmaster5000/0001072

Fixes #1072: Newer versions of Fedora use stricter code checking
  • Loading branch information...
arogge committed Sep 3, 2019
2 parents 8374154 + 0d2cb83 commit df5a1b398e730339f60830fba5abc6ff9f1f4909
Showing with 11 additions and 1 deletion.
  1. +10 −0 core/CMakeLists.txt
  2. +1 −1 core/src/tests/lib_tests.cc
@@ -43,6 +43,16 @@ if (${compiler_will_suggest_override})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
endif()

# make format-security issues a compiler-error
CHECK_CXX_COMPILER_FLAG(-Wformat compiler_format_security)
if (${compiler_format_security})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat")
endif()
CHECK_CXX_COMPILER_FLAG(-Werror=format-security compiler_error_format_security)
if (${compiler_error_format_security})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security")
endif()

# warn on sign-conversion
#include(CheckCCompilerFlag)
#CHECK_C_COMPILER_FLAG(-Wsign-conversion c_compiler_will_warn_sign_conversion)
@@ -186,7 +186,7 @@ static void do_get_name_from_hello_test(const char* client_string_fmt,
const BareosVersionNumber& version_test)
{
char bashed_client_name[20];
sprintf(bashed_client_name, client_name);
strncpy(bashed_client_name, client_name, 20);
BashSpaces(bashed_client_name);

char output_text[64];

0 comments on commit df5a1b3

Please sign in to comment.
You can’t perform that action at this time.