Move warning flags to proper place

Cleans unitialized warnings in wxApps
This commit is contained in:
Seth Hillbrand 2020-07-02 12:17:45 -07:00
parent 54aaade47e
commit 7e3a338518
5 changed files with 22 additions and 7 deletions

View File

@ -272,9 +272,6 @@ endif(USE_DISTCC)
if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
# Add additional warning flags to avoid signed/unsigned comparison
set( CMAKE_CXX_FLAGS "-Wsign-compare" )
# Set 32-bit flag for GCC to prevent excess precision # Set 32-bit flag for GCC to prevent excess precision
if( CMAKE_SIZEOF_VOID_P EQUAL 4 ) if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set( CMAKE_CXX_FLAGS "-ffloat-store ${CMAKE_CXX_FLAGS}" ) set( CMAKE_CXX_FLAGS "-ffloat-store ${CMAKE_CXX_FLAGS}" )

View File

@ -115,4 +115,22 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
message( STATUS "Enabling warning -Wshadow" ) message( STATUS "Enabling warning -Wshadow" )
endif() endif()
# Add additional warning flags to avoid signed/unsigned comparison
CHECK_CXX_COMPILER_FLAG( "-Wsign-compare" COMPILER_SUPPORTS_WSIGN )
if( COMPILER_SUPPORTS_WSIGN )
set( WARN_FLAGS_CXX "${WARN_FLAGS_CXX} -Wsign-compare" )
message( STATUS "Enabling warning -Wsign-compare" )
endif()
# Warn about missing initializers in construction
CHECK_CXX_COMPILER_FLAG( "-Wmissing-field-initializers" COMPILER_SUPPORTS_WMISSING_INIT )
if( COMPILER_SUPPORTS_WMISSING_INIT )
set( WARN_FLAGS_CXX "${WARN_FLAGS_CXX} -Wmissing-field-initializers" )
message( STATUS "Enabling warning -Wmissing-field-initializers" )
endif()
endif() endif()

View File

@ -318,10 +318,10 @@ bool PGM_SINGLE_TOP::OnPgmInit()
#endif #endif
static const wxCmdLineEntryDesc desc[] = { static const wxCmdLineEntryDesc desc[] = {
{ wxCMD_LINE_OPTION, "f", "frame", "Frame to load" }, { wxCMD_LINE_OPTION, "f", "frame", "Frame to load", wxCMD_LINE_VAL_STRING, 0 },
{ wxCMD_LINE_PARAM, nullptr, nullptr, "File to load", wxCMD_LINE_VAL_STRING, { wxCMD_LINE_PARAM, nullptr, nullptr, "File to load", wxCMD_LINE_VAL_STRING,
wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL }, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_NONE } { wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0 }
}; };
wxCmdLineParser parser( App().argc, App().argv ); wxCmdLineParser parser( App().argc, App().argv );

View File

@ -94,7 +94,7 @@ static const wxCmdLineEntryDesc cmdLineDesc[] =
wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_SWITCH, "h", NULL, "display this message", { wxCMD_LINE_SWITCH, "h", NULL, "display this message",
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
{ wxCMD_LINE_NONE } { wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0 }
}; };

View File

@ -116,7 +116,7 @@ static const wxCmdLineEntryDesc cmdLineDesc[] =
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_SWITCH, "h", NULL, _( "display this message" ).mb_str(), { wxCMD_LINE_SWITCH, "h", NULL, _( "display this message" ).mb_str(),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
{ wxCMD_LINE_NONE } { wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0 }
}; };