From b1a487fee7c8c86a61f80339ea5b595df87fc851 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 19 Oct 2023 00:27:58 +0200 Subject: [PATCH] CopyToFinalBufferSameDataType(): silence false positive -Wnull-dereference --- gcore/gdalmultidim.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcore/gdalmultidim.cpp b/gcore/gdalmultidim.cpp index 12a03305f226..c206f0dce208 100644 --- a/gcore/gdalmultidim.cpp +++ b/gcore/gdalmultidim.cpp @@ -4374,7 +4374,14 @@ void CopyToFinalBufferSameDataType(const void *pSrcBuffer, void *pDstBuffer, std::vector anStackCount(nDims); std::vector pabyDstBufferStack(nDims + 1); const GByte *pabySrcBuffer = static_cast(pSrcBuffer); +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnull-dereference" +#endif pabyDstBufferStack[0] = static_cast(pDstBuffer); +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif size_t iDim = 0; lbl_next_depth: