Skip to content

Commit

Permalink
Fix compiler warnings seen in gcc 14.2.1
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pablogsal committed Oct 30, 2024
1 parent fdc89c6 commit 19b9759
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 199 deletions.
5 changes: 4 additions & 1 deletion src/pystack/_pystack/elf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CoreFileAnalyzer : public Analyzer
std::string locateLibrary(const std::string& lib) const;

// Destructors
~CoreFileAnalyzer();
virtual ~CoreFileAnalyzer();

// Data members
dwfl_unique_ptr d_dwfl;
Expand All @@ -84,6 +84,9 @@ class ProcessAnalyzer : public Analyzer
// Constructors
explicit ProcessAnalyzer(pid_t pid);

// Destructors
virtual ~ProcessAnalyzer() = default;

// Methods
const dwfl_unique_ptr& getDwfl() const override;

Expand Down
6 changes: 6 additions & 0 deletions src/pystack/_pystack/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ class ProcessManager : public AbstractProcessManager
std::vector<VirtualMap> memory_maps,
MemoryMapInformation map_info);

// Destructors
virtual ~ProcessManager() = default;

// Getters
const std::vector<int>& Tids() const override;

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

// Destructors
virtual ~CoreFileProcessManager() = default;

// Getters
const std::vector<int>& Tids() const override;

Expand Down
2 changes: 0 additions & 2 deletions src/pystack/_pystack/pyframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "pytypes.h"
#include "version.h"

static constexpr int FRAME_LIMIT = 4096;

namespace pystack {
FrameObject::FrameObject(
const std::shared_ptr<const AbstractProcessManager>& manager,
Expand Down
1 change: 0 additions & 1 deletion src/pystack/_pystack/pytypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ GenericObject::toString(ssize_t max_size) const
}

NoneObject::NoneObject(remote_addr_t addr)
: d_addr(addr)
{
}

Expand Down
3 changes: 0 additions & 3 deletions src/pystack/_pystack/pytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ class NoneObject

// Methods
std::string toString(ssize_t max_size) const;

private:
remote_addr_t d_addr;
};

class Object
Expand Down
Loading

0 comments on commit 19b9759

Please sign in to comment.