Skip to content

Commit 0bddc32

Browse files
authored
working on cleaning up warnings when -Wconversion is enabled, there's… (#888)
* working on cleaning up warnings when -Wconversion is enabled, there's... a lot * working out some more warnings * more warning squashing... * squashing almost all of them now! * the last of them... i think * some minor tweaks * a little bit more... * the last of it? * forgot to account for debug builds! * this one only occurs when graphing is enabled * some more small improvements * formatting * removing some pointless code * formatting better auto usage
1 parent 7b4e6a1 commit 0bddc32

47 files changed

Lines changed: 264 additions & 257 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmake/Modules/AddWarnings.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function(TARGET_ADD_WARNINGS TARGET)
1414
-Wunused
1515
-Woverloaded-virtual
1616
-pedantic
17-
#-Wconversion
17+
-Wconversion
1818
#-Wsign-conversion
1919
#-Wnull-dereference
2020
-Wdouble-promotion

edb.appdata.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
<project_license>GPL-2.0</project_license>
77
<name>edb</name>
88
<summary>Reverse engineer's debugger</summary>
9-
<!--
9+
<!--
1010
<developer id="io.github.eteran">
1111
<name>edb-debugger</name>
1212
</developer>
13-
-->
13+
-->
1414
<developer_name>edb-debugger</developer_name>
1515
<description>
16-
<p>edb is a cross platform x86/x86-64 debugger. It was inspired by OllyDbg,
17-
but aims to function on x86 and x86-64 as well as multiple OS's.
18-
</p>
19-
<p>Linux is the only officially supported platform at the moment, but FreeBSD,
20-
OpenBSD, OSX and Windows ports are underway with varying degrees of functionality.
21-
</p>
16+
<p>edb is a cross platform x86/x86-64 debugger. It was inspired by OllyDbg,
17+
but aims to function on x86 and x86-64 as well as multiple OS's.
18+
</p>
19+
<p>Linux is the only officially supported platform at the moment, but FreeBSD,
20+
OpenBSD, OSX and Windows ports are underway with varying degrees of functionality.
21+
</p>
2222
</description>
2323
<screenshots>
2424
<screenshot type="default" width="1121" height="839">
25-
<image>http://codef00.com/img/debugger.png</image>
26-
<caption>Main Window, with disassembly, data, stack and registers</caption>
27-
</screenshot>
25+
<image>http://codef00.com/img/debugger.png</image>
26+
<caption>Main Window, with disassembly, data, stack and registers</caption>
27+
</screenshot>
2828
</screenshots>
2929
<update_contact>evan.teran_at_gmail.com</update_contact>
3030
<url type="homepage">https://github.com/eteran/edb-debugger</url>
@@ -36,7 +36,7 @@
3636
<content_attribute id="social-info">mild</content_attribute>
3737
</content_rating>
3838
<releases>
39-
<release version="1.5.0" date="2024-03-22"></release>
39+
<release version="1.5.0" date="2024-03-22"></release>
4040
<release version="1.4.0" date="2023-06-30"></release>
4141
</releases>
4242
</component>

include/BasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class EDB_EXPORT BasicBlock {
5959
[[nodiscard]] bool empty() const;
6060

6161
public:
62-
void swap(BasicBlock &other);
62+
void swap(BasicBlock &other) noexcept;
6363

6464
public:
6565
[[nodiscard]] QString toString() const;

include/BinaryString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class EDB_EXPORT BinaryString : public QWidget {
2727
};
2828

2929
public:
30-
BinaryString(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
30+
explicit BinaryString(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
3131
~BinaryString() override;
3232

3333
private Q_SLOTS:

include/ByteShiftArray.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class EDB_EXPORT ByteShiftArray {
2222
ByteShiftArray &shl();
2323
ByteShiftArray &shr();
2424
void clear();
25-
void swap(ByteShiftArray &other);
25+
void swap(ByteShiftArray &other) noexcept;
2626

2727
public:
2828
ByteShiftArray &operator<<(uint8_t x);

include/Configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class EDB_EXPORT Configuration : public QObject {
1717
Q_OBJECT
1818
public:
19-
Configuration(QObject *parent = nullptr);
19+
explicit Configuration(QObject *parent = nullptr);
2020
~Configuration() override;
2121

2222
public:

include/Function.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class EDB_EXPORT Function {
7070
[[nodiscard]] int referenceCount() const;
7171

7272
public:
73-
void swap(Function &other);
73+
void swap(Function &other) noexcept;
7474

7575
private:
7676
int referenceCount_ = 0;

include/State.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class EDB_EXPORT State {
3838
~State();
3939

4040
public:
41-
void swap(State &other);
41+
void swap(State &other) noexcept;
4242

4343
public:
4444
[[nodiscard]] bool empty() const;

include/Value.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ namespace v1 {
2828
EDB_EXPORT bool debuggeeIs32Bit();
2929
}
3030

31+
// TODO(eteran): honestly, this whole file is filled with conversions, so the warnings about conversions are not really helpful.
32+
// Of course, we should audit the code to make sure that all conversions are intentional and safe. For now, suppress the warnings
33+
// about conversions in this file as it's just too loud when they are enabled.
34+
#pragma GCC diagnostic push
35+
#pragma GCC diagnostic ignored "-Wconversion"
36+
#pragma GCC diagnostic ignored "-Wsign-conversion"
37+
3138
namespace detail {
3239

3340
template <class Integer>
@@ -225,7 +232,7 @@ class value_type {
225232
}
226233

227234
public:
228-
void swap(value_type &other) {
235+
void swap(value_type &other) noexcept {
229236
using std::swap;
230237
swap(value_, other.value_);
231238
}
@@ -854,6 +861,8 @@ static_assert(sizeof(value_type80) * 8 == 80, "value_type80 size is broken!");
854861

855862
}
856863

864+
#pragma GCC diagnostic pop
865+
857866
// GPR on x86
858867
using value8 = detail::value_type<uint8_t>;
859868
using value16 = detail::value_type<uint16_t>;

include/edb.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace v1 {
6262
EDB_EXPORT extern IDebugger *debugger_core;
6363
EDB_EXPORT extern QWidget *debugger_ui;
6464

65-
// the symbol mananger
65+
// the symbol manager
6666
EDB_EXPORT ISymbolManager &symbol_manager();
6767

6868
// the memory region manager
@@ -74,7 +74,7 @@ EDB_EXPORT ArchProcessor &arch_processor();
7474
// widgets
7575
EDB_EXPORT QAbstractScrollArea *disassembly_widget();
7676

77-
// breakpoint managment
77+
// breakpoint management
7878
EDB_EXPORT std::shared_ptr<IBreakpoint> find_breakpoint(address_t address);
7979
EDB_EXPORT std::shared_ptr<IBreakpoint> find_triggered_breakpoint(address_t address);
8080
EDB_EXPORT QString get_breakpoint_condition(address_t address);
@@ -175,7 +175,7 @@ EDB_EXPORT void update_ui();
175175

176176
// these are here and not members of state because
177177
// they may require using the debugger core plugin and
178-
// we don't want to force a dependancy between the two
178+
// we don't want to force a dependency between the two
179179
EDB_EXPORT void pop_value(State *state);
180180
EDB_EXPORT void push_value(State *state, reg_t value);
181181

0 commit comments

Comments
 (0)