Skip to content

Commit 19b9759

Browse files
committed
Fix compiler warnings seen in gcc 14.2.1
The latest version of gcc warns about a bunch of virtual destructors needed on non final types and some braces for subobject initialization. Signed-off-by: Pablo Galindo <[email protected]>
1 parent fdc89c6 commit 19b9759

File tree

6 files changed

+224
-199
lines changed

6 files changed

+224
-199
lines changed

src/pystack/_pystack/elf_common.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CoreFileAnalyzer : public Analyzer
5959
std::string locateLibrary(const std::string& lib) const;
6060

6161
// Destructors
62-
~CoreFileAnalyzer();
62+
virtual ~CoreFileAnalyzer();
6363

6464
// Data members
6565
dwfl_unique_ptr d_dwfl;
@@ -84,6 +84,9 @@ class ProcessAnalyzer : public Analyzer
8484
// Constructors
8585
explicit ProcessAnalyzer(pid_t pid);
8686

87+
// Destructors
88+
virtual ~ProcessAnalyzer() = default;
89+
8790
// Methods
8891
const dwfl_unique_ptr& getDwfl() const override;
8992

src/pystack/_pystack/process.h

+6
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ class ProcessManager : public AbstractProcessManager
150150
std::vector<VirtualMap> memory_maps,
151151
MemoryMapInformation map_info);
152152

153+
// Destructors
154+
virtual ~ProcessManager() = default;
155+
153156
// Getters
154157
const std::vector<int>& Tids() const override;
155158

@@ -169,6 +172,9 @@ class CoreFileProcessManager : public AbstractProcessManager
169172
std::vector<VirtualMap> memory_maps,
170173
MemoryMapInformation map_info);
171174

175+
// Destructors
176+
virtual ~CoreFileProcessManager() = default;
177+
172178
// Getters
173179
const std::vector<int>& Tids() const override;
174180

src/pystack/_pystack/pyframe.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include "pytypes.h"
1111
#include "version.h"
1212

13-
static constexpr int FRAME_LIMIT = 4096;
14-
1513
namespace pystack {
1614
FrameObject::FrameObject(
1715
const std::shared_ptr<const AbstractProcessManager>& manager,

src/pystack/_pystack/pytypes.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ GenericObject::toString(ssize_t max_size) const
494494
}
495495

496496
NoneObject::NoneObject(remote_addr_t addr)
497-
: d_addr(addr)
498497
{
499498
}
500499

src/pystack/_pystack/pytypes.h

-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ class NoneObject
118118

119119
// Methods
120120
std::string toString(ssize_t max_size) const;
121-
122-
private:
123-
remote_addr_t d_addr;
124121
};
125122

126123
class Object

0 commit comments

Comments
 (0)