From 8fe65ec371bc9a254bc57e76610beb17c63569e0 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 12 Aug 2016 19:27:24 +0200 Subject: [PATCH] cmake: add -Wextra warning on GCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add 3 new warnings (first one must be fixed I think) pcsx2/gui/MessageBoxes.cpp: In copy constructor ‘BaseMessageBoxEvent::BaseMessageBoxEvent(const BaseMessageBoxEvent&)’: pcsx2/gui/MessageBoxes.cpp:62:1: warning: base class ‘class pxActionEvent’ should be explicitly initialized in the copy constructor [-Wextra] BaseMessageBoxEvent::BaseMessageBoxEvent( const BaseMessageBoxEvent& event ) plugins/GSdx/GSPng.cpp: In function ‘bool GSPng::SaveFile(const string&, GSPng::Format, uint8*, uint8*, int, int, int, int, bool, bool)’: /home/gregory/playstation/emulateur/pcsx2_merge/plugins/GSdx/GSPng.cpp:64:14: warning: variable ‘success’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] bool success = false; ^ plugins/GSdx/GSPng.cpp:44:58: warning: argument ‘image’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] bool SaveFile(const string& file, Format fmt, uint8* image, uint8* row, --- cmake/BuildParameters.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index f13a8dcdb1..35a12753ad 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -304,10 +304,11 @@ endif() set(HARDENING_FLAG "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security") # -Wno-attributes: "always_inline function might not be inlinable" <= real spam (thousand of warnings!!!) # -Wno-missing-field-initializers: standard allow to init only the begin of struct/array in static init. Just a silly warning. +# Note: future GCC (aka GCC 5.1.1) has less false positive so warning could maybe put back # -Wno-unused-function: warn for function not used in release build # -Wno-unused-variable: just annoying to manage different level of logging, a couple of extra var won't kill any serious compiler. # -Wno-unused-value: lots of warning for this kind of statements "0 && ...". There are used to disable some parts of code in release/dev build. -set(DEFAULT_WARNINGS "-Wall -Wno-attributes -Wno-missing-field-initializers -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable ") +set(DEFAULT_WARNINGS "-Wall -Wextra -Wno-attributes -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers ") if (NOT USE_ICC) set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-unused-value ") endif() @@ -316,7 +317,7 @@ endif() if (USE_ICC) set(AGGRESSIVE_WARNING "-Wstrict-aliasing ") else() - set(AGGRESSIVE_WARNING "-Wstrict-aliasing -Wstrict-overflow=2 ") + set(AGGRESSIVE_WARNING "-Wstrict-aliasing -Wstrict-overflow=1 ") endif() if (USE_CLANG)