Permalink
Browse files

Enable -Wformat-security for gcc and fix one warning (GH-64)

Fedora has -Werror=format-security enabled per default, so enabling and
fixing these warnings is a good idea.
  • Loading branch information...
lluchs committed Feb 6, 2018
1 parent 3ad91ee commit 08edf3bb583f55cf5bf7ba1050ba86632f02a6e0
Showing with 2 additions and 2 deletions.
  1. +1 −1 CMakeLists.txt
  2. +1 −1 src/editor/C4ConsoleQtNewScenario.cpp
@@ -158,7 +158,7 @@ endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wextra-tokens -Wpointer-arith -Wno-cast-align -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual")
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wformat-security")
endif()

if(WIN32 AND MINGW)
@@ -405,7 +405,7 @@ bool C4ConsoleQtNewScenarioDlg::CreateScenario()
{
// Try to create scenario from template. Unpack if necessery.
QVariant tmpl_data = ui.templateComboBox->currentData();
LogF(tmpl_data.toString().toUtf8());
Log(tmpl_data.toString().toUtf8());
StdStrBuf template_filename;
template_filename.Copy(tmpl_data.toString().toUtf8());
if (DirectoryExists(template_filename.getData()))

0 comments on commit 08edf3b

Please sign in to comment.