util/DisposablePointer: suppress -Wuninitialized
I pretend to know what I'm doing :-)
This commit is contained in:
parent
fae5d16d43
commit
4a2fff019a
|
@ -6,6 +6,15 @@
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 13
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
/* suppress -Wuninitialized; GCC is right, the "dispose" field is
|
||||||
|
sometimes not initialized (if ptr==nullptr), but it's only swapped
|
||||||
|
in the move operator/constructor, and that's okay, we're not going
|
||||||
|
to use it in that case anyway */
|
||||||
|
#pragma GCC diagnostic ignored "-Wuninitialized"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A generic object which is owned by somebody who doesn't know how to
|
* A generic object which is owned by somebody who doesn't know how to
|
||||||
* dispose of it; to do this, a function pointer for disposing it is
|
* dispose of it; to do this, a function pointer for disposing it is
|
||||||
|
@ -62,6 +71,10 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 13
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class TypedDisposablePointer : public DisposablePointer {
|
class TypedDisposablePointer : public DisposablePointer {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue