Skip to content

Commit

Permalink
Fix weak vtable warning regarding xml_writer
Browse files Browse the repository at this point in the history
Using Apple clang (clang-1400.0.29.202) with `-Wweak-vtables` would produce the following warning:

'xml_writer' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables]
asmaloney committed Apr 21, 2023
1 parent f4b8946 commit 058fc60
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/pugixml.cpp
Original file line number Diff line number Diff line change
@@ -5111,6 +5111,10 @@ PUGI_IMPL_NS_END

namespace pugi
{
PUGI_IMPL_FN xml_writer::~xml_writer()
{
}

PUGI_IMPL_FN xml_writer_file::xml_writer_file(void* file_): file(file_)
{
}
2 changes: 1 addition & 1 deletion src/pugixml.hpp
Original file line number Diff line number Diff line change
@@ -324,7 +324,7 @@ namespace pugi
class PUGIXML_CLASS xml_writer
{
public:
virtual ~xml_writer() {}
virtual ~xml_writer();

// Write memory chunk into stream/file/whatever
virtual void write(const void* data, size_t size) = 0;

0 comments on commit 058fc60

Please sign in to comment.