diff --git a/src/util/DisposablePointer.hxx b/src/util/DisposablePointer.hxx index 2ee30e410..c6481109c 100644 --- a/src/util/DisposablePointer.hxx +++ b/src/util/DisposablePointer.hxx @@ -6,6 +6,15 @@ #include +#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 * 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 class TypedDisposablePointer : public DisposablePointer { public: