From: Christoph Egger Date: Tue, 3 Mar 2015 19:15:18 +0000 (+0100) Subject: Use -Wextra and be -Wextra-clean X-Git-Tag: v0.1~79 X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=ccde95277ce5e3929d09aef387c2f5956592d066;p=frida%2Ffrida.git Use -Wextra and be -Wextra-clean --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f309be7..7b86634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,10 +34,11 @@ string(REPLACE -O2 "" LLVM_CFLAGS ${LLVM_CFLAGS}) string(REPLACE -fno-exceptions "" LLVM_CFLAGS ${LLVM_CFLAGS}) string(REPLACE -fno-rtti "" LLVM_CFLAGS ${LLVM_CFLAGS}) string(REPLACE -DNDEBUG "" LLVM_CFLAGS ${LLVM_CFLAGS}) +string(REPLACE -I "-isystem" LLVM_CFLAGS ${LLVM_CFLAGS}) separate_arguments(LLVM_CFLAGS) add_definitions(${LLVM_CFLAGS}) -add_definitions(-std=c++11 -Wall) +add_definitions(-std=c++11 -Wall -Wextra) add_definitions(-DQT_NO_KEYWORDS) separate_arguments(LLVM_LDFLAGS) diff --git a/src/disassembler/Disassembler.hxx b/src/disassembler/Disassembler.hxx index 776796a..fe240a9 100644 --- a/src/disassembler/Disassembler.hxx +++ b/src/disassembler/Disassembler.hxx @@ -10,7 +10,7 @@ class InformationManager; class Disassembler { public: - Disassembler(const std::string& filename, InformationManager* manager) {} + Disassembler() {} virtual ~Disassembler() {} virtual void start() = 0; @@ -21,9 +21,6 @@ public: std::function fun) = 0; virtual Function * disassembleFunctionAt(uint64_t address, const std::string& name = "") = 0; -protected: - virtual bool isFunctionCall(uint64_t address) = 0; - virtual bool isJump(uint64_t address) = 0; }; #endif diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index aeca994..abfafa4 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -48,7 +48,7 @@ template LLVMDisassembler::LLVMDisassembler(const std::string& filename, InformationManager* manager, ELFObjectFile* file) - : Disassembler(filename, manager) + : Disassembler() , logger(log4cxx::Logger::getLogger("LLVMDisassembler")) , triple("unknown-unknown-unknown") , manager(manager) diff --git a/src/disassembler/llvm/LLVMDisassembler.hxx b/src/disassembler/llvm/LLVMDisassembler.hxx index d00381b..6c55b44 100644 --- a/src/disassembler/llvm/LLVMDisassembler.hxx +++ b/src/disassembler/llvm/LLVMDisassembler.hxx @@ -32,10 +32,6 @@ public: Function * disassembleFunctionAt(uint64_t address, const std::string& name = ""); -protected: - bool isFunctionCall(uint64_t address) {return false;} - bool isJump(uint64_t address) {return false;} - private: typedef llvm::object::ELFFile ELFO; diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 47ab2a3..0c08892 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -116,7 +116,7 @@ void Mainwindow::switchMainPlaneToAddress(uint64_t address) { } } -void Mainwindow::switchMainPlane(int index) { +void Mainwindow::switchMainPlane(int) { stackedWidget->setCurrentWidget(objects_list[listWidget->currentItem()]); } diff --git a/src/gui/dialogs/SimpleStringDialog.cxx b/src/gui/dialogs/SimpleStringDialog.cxx index 8bea6e9..0adb71e 100644 --- a/src/gui/dialogs/SimpleStringDialog.cxx +++ b/src/gui/dialogs/SimpleStringDialog.cxx @@ -20,7 +20,6 @@ SimpleStringDialog::SimpleStringDialog(const QString& title) { } QString SimpleStringDialog::result() { - bool ok; QString result = edit->text(); return result; } diff --git a/src/gui/widgets/BasicBlockWidget.cxx b/src/gui/widgets/BasicBlockWidget.cxx index 1f34255..908c85e 100644 --- a/src/gui/widgets/BasicBlockWidget.cxx +++ b/src/gui/widgets/BasicBlockWidget.cxx @@ -154,8 +154,8 @@ void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes, _table->cellAt(row, 1).firstCursorPosition().insertHtml(line); } -void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget) { +void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*, + QWidget*) { width = 10 + _widget->boundingRect().width(); height = 25 + _widget->boundingRect().height(); if (width < 250) width = 250; diff --git a/src/gui/widgets/ScriptingDock.cxx b/src/gui/widgets/ScriptingDock.cxx index 86bc766..ce00030 100644 --- a/src/gui/widgets/ScriptingDock.cxx +++ b/src/gui/widgets/ScriptingDock.cxx @@ -1,7 +1,7 @@ #include "ScriptingDock.hxx" namespace { - SCM handler (void *data, SCM tag, SCM throw_args) { + SCM handler (void*, SCM tag, SCM throw_args) { scm_handle_by_message_noexit ((void*)"foo", tag, throw_args); return SCM_BOOL_F; }