Hide compiler warning.
authorCarl Hetherington <cth@carlh.net>
Sun, 24 Sep 2023 11:13:40 +0000 (13:13 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 Oct 2023 11:46:37 +0000 (13:46 +0200)
In file included from ../src/lib/grok/context.h:29,
                 from ../src/lib/j2k_encoder.h:36,
                 from ../src/lib/grok_j2k_encoder_thread.cc:5:
In member function ‘void grk_plugin::Synch::unlink()’,
    inlined from ‘grk_plugin::Synch::Synch(const string&, const string&)’ at ../src/lib/grok/messenger.h:200:10:
../src/lib/grok/messenger.h:247:52: error: ‘this’ pointer is null [-Werror=nonnull]
  247 |                         getMessengerLogger()->error("Error unlinking semaphore %s: %s", sentSemName_.c_str(),
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  248 |                                                                                 strerror(errno));

on Ubuntu 22.04.

wscript

diff --git a/wscript b/wscript
index 4629fb24314b1229d330ed6c1a610a2173359311..bbd73f64c4c015ce7a1d9974d557078bc2bb0379 100644 (file)
--- a/wscript
+++ b/wscript
@@ -112,6 +112,8 @@ def configure(conf):
                                        '-Wextra',
                                        '-Wwrite-strings',
                                        '-Wno-error=deprecated',
+                                       # getMessengerLogger() in the grok code triggers these warnings
+                                       '-Wno-nonnull',
                                        # I tried and failed to ignore these with _Pragma
                                        '-Wno-ignored-qualifiers',
                                        '-D_FILE_OFFSET_BITS=64',