]> source.dussan.org Git - tigervnc.git/commitdiff
Disable gcc NULL warning for context menu
authorPierre Ossman <ossman@cendio.se>
Wed, 3 Apr 2024 10:38:04 +0000 (12:38 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 24 Jun 2024 11:42:54 +0000 (13:42 +0200)
We use the pointer to just store an identifier for the menu, but this is
enough for gcc to think we are using 0 instead of nullptr and complain.
Even an explicit cast isn't enough to silence it here for some reason.

vncviewer/Viewport.cxx

index bbccc2f925167e1e00765fd674174091da47c0b7..0c2cb862ce171249a94860563700f8a0c6a8d84c 100644 (file)
@@ -1222,6 +1222,9 @@ void Viewport::resolveAltGrDetection(bool isAltGrSequence)
 }
 #endif
 
+// FIXME: gcc confuses ID_DISCONNECT with NULL
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
 void Viewport::initContextMenu()
 {
   contextMenu->clear();
@@ -1268,7 +1271,7 @@ void Viewport::initContextMenu()
   fltk_menu_add(contextMenu, p_("ContextMenu|", "About &TigerVNC viewer..."),
                 0, nullptr, (void*)ID_ABOUT, 0);
 }
-
+#pragma GCC diagnostic pop
 
 void Viewport::popupContextMenu()
 {