From 965308fac7a1bc5652921556f50984ce7c23c6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 15 Oct 2024 14:02:33 -0400 Subject: [PATCH] COMP: Suppress false positive non-null warning by GCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error message was: In file included from /home/dzenan/ITKNornir/include/IRGridCommon.h:33, from /home/dzenan/ITKNornir/src/IRGridCommon.cxx:30: /home/dzenan/ITKNornir/include/itkIRCommon.h: In function ‘typename legendre_transform_t::Pointer approx_transform(const pnt2d_t&, const pnt2d_t&, const mask_t*, const base_transform_t*, unsigned int, unsigned int, bool) [with legendre_transform_t = itk::LegendrePolynomialTransform]’: /home/dzenan/ITKNornir/include/itkIRCommon.h:6305:51: warning: ‘this’ pointer is null [-Wnonnull] 6305 | vec2d_t shift = center - inverse->TransformPoint(center); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ --- include/itkIRCommon.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/itkIRCommon.h b/include/itkIRCommon.h index f0c3a64..0d6629d 100644 --- a/include/itkIRCommon.h +++ b/include/itkIRCommon.h @@ -6302,7 +6302,10 @@ approx_transform(const pnt2d_t & tile_min, // calculate the shift: pnt2d_t center = pnt2d(tile_min[0] + (tile_max[0] - tile_min[0]) / 2.0, tile_min[1] + (tile_max[1] - tile_min[1]) / 2.0); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnonnull" vec2d_t shift = center - inverse->TransformPoint(center); +#pragma GCC diagnostic pop typename legendre_transform_t::Pointer approx = setup_transform(tile_min, tile_max); approx->setup_translation(shift[0], shift[1]);